Closed ItsClairton closed 2 years ago
do you have any playlist for this? I guess it's the limitation of one page, maybe we can go through all pages and fetch all items, need to do some study with example, but now doesn't support it.
Here is the one I used as a test: https://www.youtube.com/playlist?list=PLhsz9CILh357zA1yMT-K5T9ZTNEU6Fl6n
Probably it's limitation per page.
Unfortunately, I can't find useful information in the response body neither the request to fetch next page, maybe other expert can know how to fetch the entire playlist. label this issue.
I managed to get it working, I made a quick implementation on my fork (I'm not a go developer so forgive me).
I found out that in the initial data, we have a "continuation command" token at this location: $.contents.twoColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].playlistVideoListRenderer.contents[100].continuationItemRenderer.continuationEndpoint.continuationCommand.token
Then, calling this route https://www.youtube.com/youtubei/v1/browse?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8
with this token in the continuation
field returns the 100 next videos, with another "continuation command" token, but this time the location is $.onResponseReceivedActions[0].appendContinuationItemsAction.continuationItems[100].continuationItemRenderer.continuationEndpoint.continuationCommand.token
(the location of the videos also changes)
Note that the index 100
in the paths above actually means "the last index"
I tested to download videos from the start/mid/end of a playlist with 669 videos and it worked, but as I said it's a quick implementation and I might have put things in the wrong place or missed something, so feel free to reuse/modify it directly in this repository.
Thank you very much for your fork, I tested it here with 1558 videos, and it worked correctly.
awesome @xesnault , you're today's super star!!!
Your fork just worked like a charm and it saved a hell lot of my time!!! Thanks a ton @xesnault...
If you use
client.GetPlaylist()
with any playlist that has more than 100 items, it will only return the first 100 items. Is there any way to exceed this limit?Sorry for English, Google Translate.