Giter Site home page Giter Site logo

ytt's People

Contributors

bakapear avatar labecasse avatar mburon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

labecasse

ytt's Issues

Electron/Nw.js Support?

This module works very well for node.js but if you try to use it under electron/nw.js it throws an error which makes it unusable:

Example (using Nw.js or Electron) :

var ytt = require("ytt");
ytt.playlist('PLCxjFBEyIgt1FmIYPZrodi19Vv_Z8K9LJ', true) // or any other method except "format" method

it throws :
Uncaught (in promise) TypeError [ERR_INVALID_ARG_TYPE]: The "listener" argument must be of type Function. Received type object

util.parse error

Hello, I realize that the util.parse function leads to errors, because some scrapped pages does not contain window["ytInitialData"] = , but var ytInitialData = instead.

So consider the following parse function solves my error:

parse: x => main.between(x, 'var ytInitialData = ', '};', 1)

Is it possible to support the both alternatives ?

"Not an ID" error with some playlists

Uncaught Promise Rejection Error: Not an ID: 'PL4E1AE167C56AA012' at Object.error (/rbd/pnpm-volume/443e9cdc-4277-44b6-bfe1-27aff93692ed/node_modules/.registry.npmjs.org/ytt/2.0.5/node_modules/ytt/src/lib/util.js:3:15) at Object.module.exports [as valid] (/rbd/pnpm-volume/443e9cdc-4277-44b6-bfe1-27aff93692ed/node_modules/.registry.npmjs.org/ytt/2.0.5/node_modules/ytt/src/valid.js:11:27)

Really nice package, but i have "Not an ID" error when trying to get videos from playlists with...hm, "old type" id. For example, 'PL4E1AE167C56AA012', 'PL508A218FC66DAD72'.

Code example (working):
let playlist = await ytt.playlist('PLDfKAXSi6kUareOEtT2PsmWMmWVOWOs4x', { full: true }) if(playlist.items.continuation) await playlist.items.more() console.log(playlist.items.length)
Url: "https://www.youtube.com/watch?v=Shk7qcvqDOo&list=PLDfKAXSi6kUareOEtT2PsmWMmWVOWOs4x"

(not working. Will give "not an id" error):
let playlist = await ytt.playlist('PL4E1AE167C56AA012', { full: true }) if(playlist.items.continuation) await playlist.items.more() console.log(playlist.items.length)
Url: "https://www.youtube.com/playlist?list=PL4E1AE167C56AA012"

Error on some video with ytt.video('id') method

Sup.
On some videos id, "video" method gives error.
Videos example:
https://www.youtube.com/watch?v=HA8JI1vM2FA
https://www.youtube.com/watch?v=MTvUCo0h8PI

Code example:
async function test() { let video = await ytt.video('HA8JI1vM2FA') console.log(video) } test()

Error:
(node:400) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'simpleText' of undefined at Object.text ("your project"/node_modules/ytt/src/lib/util.js:16:66) at Object.makeVideoObject ("your project"/node_modules/ytt/src/lib/builder.js:114:35) at Object.module.exports [as video] ("your project"/node_modules/ytt/src/video.js:9:23) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Client.<anonymous> ("your project"/Test/main.js:1473:13)

Empty query answer

Hello,
First of all, thank you for this amazing package.
I discover some problems using the query method. The following queries lead to empty result, which is not the case in YT:

  1. joy departed
  2. Marvin Gaye, 'What's Going On'

The case 1. is maybe related to the fact that an album is attached to the answer. The case 2. may be caused by the quotes.

query continuation not working anymore

search.items.continuation is always false:

let search = await ytt.query('ducks making very weird noises')
console.log(search.items.length) // 20
if (search.items.continuation) await search.items.more()
console.log(search.items.length) // 20

Because continuations[0].nextContinuationData.continuation does not exist anymore:

continuation: list.continuations ? list.continuations[0].nextContinuationData.continuation : null,

continuation: body.continuations ? body.continuations[0].nextContinuationData.continuation : null,

We could replace it with continuationItemRenderer.continuationCommand.token, however currently it gives the same items back and not the next ones.

Scrolling down the YouTube results page reveals that they've changed the way results get fetched.
The request uses the offical YouTube API now and requires an API key.
(disable_polymer not working anymore either)

Looking for possible workarounds...

(playlist continuation works fine though, because a continuations object is provided)

Error on ?some? videos with method ytt.video(video_id)

For example, videos video1, video2 gives error

Checking video with await ytt.valid(video_id) gives true
Searching videos with await ytt.query('search text', { filter: 'video', num: 20 }) and finding that video is ok

But when trying to use await ytt.video(video_id), it gives error
TypeError: Cannot read property 'accessibilityData' of undefined at Object.makeVideoObject (/project/node_modules/ytt/src/lib/builder.js:107:125) at Object.module.exports [as video] (/project/node_modules/ytt/src/video.js:9:23)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.