bakapear / ytt

YouTubeTools
MIT License
6 stars 1 forks source link

"Not an ID" error with some playlists #3

Closed Erfesto closed 3 years ago

Erfesto commented 3 years ago

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"

bakapear commented 3 years ago

Oh I didn't know playlists with fewer characters existed! I'll fix this shortly!

(Also you don't need to use playlist.items.more() when you have set { full: true })

Erfesto commented 3 years ago

Thanks :)