TimeForANinja / node-ytpl

Anonymous YouTube playlist resolver.
MIT License
203 stars 48 forks source link

Support For Mixes #7

Open 5punk opened 6 years ago

5punk commented 6 years ago

Every Time I Try to fetch the ids from a youtube mix list I get an error.

Error: Unable to find a id in RDFJJ8hWDXWGs
    at Object.exports.get_playlist_id

example: https://www.youtube.com/watch?v=dQLngV189IU&list=RDdQLngV189IU

TimeForANinja commented 6 years ago

Mixes aren't handled like regular playlist's and there's also the problem with them being infinite scrollable...

yinkiu602 commented 4 years ago

Hi, @TimeForANinja , is there any update on the Mix playlist now? I am trying to make a bot to download the video in the mix list. AFAIK the youtube-dl works with the mix link, while it seems that ytpl and ytdl-core still havent support it. So, is there anyway to achieve it? Thanks

TimeForANinja commented 4 years ago

Did some testing in https://github.com/TimeForANinja/node-ytpl/tree/mix_test feel free to try it, using ytpl.getMix(startVideoID, mixID, (err, data) => { /* do sth with data */ }) even thou calling the function twice already returns different results

the page usually used to resolve the playlist doesn't work for mixes 😞

yinkiu602 commented 4 years ago

Wow, thanks for your help, will definitely try it when I have time :) Originally I didn't even know what youtube mix isπŸ˜‚, but after I tried to start coding my first discord bot, copying the mix link that worked on a python bot and trying to use it here...... and nothing! Nothing works πŸ˜‚πŸ˜‚. Let's see if this will work :) Even different results will be fine πŸ‘

joek85 commented 3 years ago

The diffrence between mix playlist and normal one is that the mix's misses the author informations like avatar and name which failed for me, otherwise it works like a normal playlist and fetched all videos. try to go to a mix playlist and a normal one and you can see the difference.

TimeForANinja commented 3 years ago

The diffrence between mix playlist and normal one is that the mix's misses the author informations like avatar and name which failed for me, otherwise it works like a normal playlist and fetched all videos. try to go to a mix playlist and a normal one and you can see the difference.

That's not (always?) true take this for example you can see the mix on a video: https://www.youtube.com/watch?v=ozXb10fOi2A&list=RDozXb10fOi2A&start_radio=1&rv=ozXb10fOi2A but there is no underlying playlist: https://www.youtube.com/playlist?list=RDozXb10fOi2A

joek85 commented 3 years ago

You are right but in my case, i was fetching a playlist from YouTube music channel like this one: https://www.youtube.com/watch?v=91VRyTvjoX4&list=RDCLAK5uy_m5j6nB_IPvvtoiErZo8aUsj_8pcUHLqUQ&start_radio=1

however i inspected the mix div and i found this<div id="items" class="playlist-items yt-scrollbar-dark style-scope ytd-playlist-panel-renderer"><ytd-playlist-panel-video-renderer class="style-scope ytd-playlist-panel-renderer" lockup="" watch-color-update_="" id="playlist-items"><!--css-build:shady--> <a id="wc-endpoint" class="yt-simple-endpoint style-scope ytd-playlist-panel-video-renderer" href="/watch?v=ozXb10fOi2A&amp;list=RDozXb10fOi2A&amp;index=1">

maybe i can help with parsing the video items but maybe we will be limited to 25 videos but that's fine if we made this work.

EDIT: i think this issue is related to ytdl-core not this repo.

TimeForANinja commented 3 years ago

EDIT: i think this issue is related to ytdl-core not this repo.

yep, since we never pull the individual video page

would require some changes thou, since ytdl-core only parses the video id from the provided links and ignores all other querys like e.g. list=