When getting a playlist (in my case it was a big playlist, 1124 videos), not all videos are returned.
The missing videos are always the last in the playlist.
Looks like YoutubeExplode is using youtube.com/list_ajax and not the v3 playlist API, the issue could be on Youtube's side.
It could be that the video is private or blocked?
The videos are public and show up when using the v3 playlist API manually.
Can you share the playlist URL?
I can reproduce it again with this playlist PLdyYtz46NolYIY3J8Dg32ZjwiC2NGeriD.
Out of the 113 videos, 13 are private, but I'm getting 86.
Managed to reproduce this.
Here's the list of video titles from YouTube (https://www.youtube.com/playlist?list=PLdyYtz46NolYIY3J8Dg32ZjwiC2NGeriD)
Game of Thrones Season 5: Episode #10 Clip - Dany is Surrounded (HBO)
Game of Thrones Season 5: Episode #10 - Cersei's Walk of Atonement (HBO)
Game of Thrones Season 5: Episode #10 - Myrcella's Long Farewell (HBO)
Game of Thrones Season 5: Inside the Episode #10 (HBO)
Game of Thrones Season 5: Episode #9 Clip - Daenerys' Escape (HBO)
Game of Thrones Season 5: Episode #9 - The Fighting Pits of Meereen (HBO)
Game of Thrones Season 5: Episode #9 - Trusting Jaime Lannister (HBO)
Game of Thrones Season 5: Inside the Episode #9 (HBO)
Game of Thrones Season 5: Episode #10 Preview (HBO)
Game of Thrones Season 5: Episode #8 Recap (HBO)
Game of Thrones Season 5: Episode #8 - The Massacre at Hardhome (HBO)
Game of Thrones Season 5: Episode #7 Clip – Cersei and the High Sparrow (HBO)
Game of Thrones Season 5: Episode #8 Preview (HBO)
Game of Thrones Season 5: Episode #7 - Sam's Bond with Gilly (HBO)
Game of Thrones Season 5: Inside the Episode #7 (HBO)
Game of Thrones Season 5: Episode #6 Recap (HBO)
Game of Thrones Season 5: Episode #6 Clip - The Hall of Faces (HBO)
Game of Thrones Season 5: Inside the Episode #6 (HBO)
Game of Thrones Season 5: Episode #6 - Arya & the Hall of Faces
Game of Thrones Season 5: Episode #6 - House of Black and White & the Hall of Faces
Game of Thrones Season 5: Episode #6 - A Father's Death (HBO)
Game of Thrones Season 5: Episode #7 Preview (HBO)
Game of Thrones Season 5: Episode #5 Recap (HBO)
Game of Thrones Season 5: New Characters & Locations (HBO)
Game of Thrones Season 5: Episode #5 Clip - Jorah and Tyrion (HBO)
Game of Thrones Season 5: Episode #5 Clip - Jorah and Tyrion (HBO)
Game of Thrones Season 5: Episode #5 - Sansa Meets Reek (HBO)
Game of Thrones Season 5: Episode #5 - Sansa Meets Reek (HBO)
Game of Thrones Season 5: Episode #5 - The Stone Men (HBO)
Game of Thrones Season 5: Episode #5 - The Stone Men of Valyria (HBO)
Game of Thrones Season 5: Episode #6 Preview (HBO)
Game of Thrones Season 5: Episode #5 - The Stone Men (HBO)
Game of Thrones Season 5: Episode #5 - The Stone Men of Valyria (HBO)
Game of Thrones Season 5: Episode #6 Preview (HBO)
Game of Thrones Season 5: Episode #5 - Daenerys and the Masters (HBO)
Game of Thrones Season 5: Inside the Episode #5 (HBO)
Game of Thrones Season 5: Episode #5 - Daenerys and the Masters (HBO)
Game of Thrones Season 5: Inside the Episode #5 (HBO)
Game of Thrones Season 5: Episode #4 Recap (HBO)
Game of Thrones Season 5: Episode #4 Recap (HBO)
Game of Thrones Season 5: Episode #4 Clip - The Sand Snakes (HBO)
Game of Thrones Season 5: Episode #4 Clip - The Sand Snakes (HBO)
Game of Thrones Season 5: Episode #5 Preview (HBO
Game of Thrones Season 5: Episode #5 Preview (HBO
Game of Thrones Season 5: Episode #4 - The High Sparrow (HBO)
Game of Thrones Season 5: Episode #4 - Sophie Turner on Trusting Littlefinger (HBO)
Game of Thrones Season 5: Inside the Episode #4 (HBO)
Game of Thrones Season 5: Episode #4 - The High Sparrow (HBO)
Game of Thrones Season 5: Episode #4 - Sophie Turner on Trusting Littlefinger (HBO)
Game of Thrones Season 5: Inside the Episode #4 (HBO)
Game of Thrones Season 5: Episode #3 Recap (HBO)
Game of Thrones Season 5: Episode #3 Recap (HBO)
Game of Thrones Season 5: Anatomy of a Scene - Mance Rayder (HBO)
Game of Thrones Season 5: Episode #3 Clip - Sansa's Proposal (HBO)
Game of Thrones Season 5: Episode #4 Preview (HBO)
Game of Thrones Season 5: Episode #3 - Arya's Service with the Faceless Men (HBO)
Game of Thrones Season 5: Episode #3 - Kit Harington on Executing Janos Slynt (HBO)
Game of Thrones Season 5: Inside the Episode #3 (HBO)
Game of Thrones Season 5: Episode #2 Recap (HBO)
Game of Thrones Season 5: Episode #2 - Clip (HBO)
Game of Thrones Season 5: Episode #3 Preview (HBO)
Game of Thrones Season 5: Inside the Episode #2 (HBO)
Game of Thrones Season 5: Episode #2 - Dorne & the Water Gardens Featurette (HBO)
Game of Thrones Season 5: Episode #2 - A Threat Against Myrcella (HBO)
Game of Thrones Season 5: Episode #1 Recap (HBO)
Game of Thrones Season 5: Episode #1 Clip - Cersei's Prophecy (HBO)
Game of Thrones Season 5: Episode #1 - Kit Harington & Ciarán Hinds on Mance Rayder (HBO)
Game of Thrones Season 5: Inside the Episode #1 (HBO)
Game of Thrones Season 5: Episode #2 Preview (HBO)
Game of Thrones Season 5: Season 4 Recap (HBO)
Game of Thrones Season 5: Enemy Promo (HBO)
Game of Thrones Season 5: Future Promo (HBO)
Game of Thrones Season 5: Sinners Promo (HBO)
Game of Thrones: Red Carpet San Francisco Recap (HBO)
Game of Thrones: #GoTBetrayals Promo (HBO)
Game of Thrones Season 5: Jon & Mance (HBO)
Game of Thrones Season 5: Tyrion & Varys (HBO)
Game of Thrones: Children of the Forest (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Available Now on Soundcloud (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Mushroomhead (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Melanie Fiona (HBO)
Game of Thrones Season 5: Preview (HBO)
Game of Thrones Season 5: Artisan Piece #2 – Set Design (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Snoop Dogg (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Stalley (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Ty Dolla $ign (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Yandel (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Estelle (HBO)
Game of Thrones Season 5: Trailer #2 - The Wheel (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Raquel Sofia
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Kap G
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Talib Kweli
Game of Thrones Season 5: Artisan Piece #1: The Weapons of Dorne (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Anthrax
Game of Thrones Season 5: The Sight: Brienne and Podrick (HBO)
Game of Thrones Season 5: The Sight: Jon Snow and Mance (HBO)
Game of Thrones: Blooper Reel #2 (HBO)
Game of Thrones: Will Simpson Drawing Storyboards (HBO)
Game of Thrones Season 5: A Day in the Life (HBO)
Game of Thrones Season 5: Day in the Life (HBO)
[Private video]
[Private video]
[Private video]
[Private video]
[Private video]
[Private video]
[Private video]
[Private video]
[Private video]
[Private video]
[Private video]
[Private video]
[Private video]
And here it is from YoutubeExplode
Game of Thrones Season 5: Episode #10 Clip - Dany is Surrounded (HBO)
Game of Thrones Season 5: Episode #10 - Cersei's Walk of Atonement (HBO)
Game of Thrones Season 5: Episode #10 - Myrcella's Long Farewell (HBO)
Game of Thrones Season 5: Inside the Episode #10 (HBO)
Game of Thrones Season 5: Episode #9 Clip - Daenerys' Escape (HBO)
Game of Thrones Season 5: Episode #9 - The Fighting Pits of Meereen (HBO)
Game of Thrones Season 5: Episode #9 - Trusting Jaime Lannister (HBO)
Game of Thrones Season 5: Inside the Episode #9 (HBO)
Game of Thrones Season 5: Episode #10 Preview (HBO)
Game of Thrones Season 5: Episode #8 Recap (HBO)
Game of Thrones Season 5: Episode #8 - The Massacre at Hardhome (HBO)
Game of Thrones Season 5: Episode #7 Clip – Cersei and the High Sparrow (HBO)
Game of Thrones Season 5: Episode #8 Preview (HBO)
Game of Thrones Season 5: Episode #7 - Sam's Bond with Gilly (HBO)
Game of Thrones Season 5: Inside the Episode #7 (HBO)
Game of Thrones Season 5: Episode #6 Recap (HBO)
Game of Thrones Season 5: Episode #6 Clip - The Hall of Faces (HBO)
Game of Thrones Season 5: Inside the Episode #6 (HBO)
Game of Thrones Season 5: Episode #6 - Arya & the Hall of Faces
Game of Thrones Season 5: Episode #6 - House of Black and White & the Hall of Faces
Game of Thrones Season 5: Episode #6 - A Father's Death (HBO)
Game of Thrones Season 5: Episode #7 Preview (HBO)
Game of Thrones Season 5: Episode #5 Recap (HBO)
Game of Thrones Season 5: New Characters & Locations (HBO)
Game of Thrones Season 5: Episode #5 Clip - Jorah and Tyrion (HBO)
Game of Thrones Season 5: Episode #5 - Sansa Meets Reek (HBO)
Game of Thrones Season 5: Episode #5 - The Stone Men (HBO)
Game of Thrones Season 5: Episode #5 - The Stone Men of Valyria (HBO)
Game of Thrones Season 5: Episode #6 Preview (HBO)
Game of Thrones Season 5: Episode #5 - Daenerys and the Masters (HBO)
Game of Thrones Season 5: Inside the Episode #5 (HBO)
Game of Thrones Season 5: Episode #4 Recap (HBO)
Game of Thrones Season 5: Episode #4 Clip - The Sand Snakes (HBO)
Game of Thrones Season 5: Episode #5 Preview (HBO
Game of Thrones Season 5: Episode #4 - The High Sparrow (HBO)
Game of Thrones Season 5: Episode #4 - Sophie Turner on Trusting Littlefinger (HBO)
Game of Thrones Season 5: Inside the Episode #4 (HBO)
Game of Thrones Season 5: Episode #3 Recap (HBO)
Game of Thrones Season 5: Anatomy of a Scene - Mance Rayder (HBO)
Game of Thrones Season 5: Episode #3 Clip - Sansa's Proposal (HBO)
Game of Thrones Season 5: Episode #4 Preview (HBO)
Game of Thrones Season 5: Episode #3 - Arya's Service with the Faceless Men (HBO)
Game of Thrones Season 5: Episode #3 - Kit Harington on Executing Janos Slynt (HBO)
Game of Thrones Season 5: Inside the Episode #3 (HBO)
Game of Thrones Season 5: Episode #2 Recap (HBO)
Game of Thrones Season 5: Episode #2 - Clip (HBO)
Game of Thrones Season 5: Episode #3 Preview (HBO)
Game of Thrones Season 5: Inside the Episode #2 (HBO)
Game of Thrones Season 5: Episode #2 - Dorne & the Water Gardens Featurette (HBO)
Game of Thrones Season 5: Episode #2 - A Threat Against Myrcella (HBO)
Game of Thrones Season 5: Episode #1 Recap (HBO)
Game of Thrones Season 5: Episode #1 Clip - Cersei's Prophecy (HBO)
Game of Thrones Season 5: Episode #1 - Kit Harington & Ciarán Hinds on Mance Rayder (HBO)
Game of Thrones Season 5: Inside the Episode #1 (HBO)
Game of Thrones Season 5: Episode #2 Preview (HBO)
Game of Thrones Season 5: Season 4 Recap (HBO)
Game of Thrones Season 5: Enemy Promo (HBO)
Game of Thrones Season 5: Future Promo (HBO)
Game of Thrones Season 5: Sinners Promo (HBO)
Game of Thrones: Red Carpet San Francisco Recap (HBO)
Game of Thrones: #GoTBetrayals Promo (HBO)
Game of Thrones Season 5: Jon & Mance (HBO)
Game of Thrones Season 5: Tyrion & Varys (HBO)
Game of Thrones: Children of the Forest (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Available Now on Soundcloud (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Mushroomhead (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Melanie Fiona (HBO)
Game of Thrones Season 5: Preview (HBO)
Game of Thrones Season 5: Artisan Piece #2 – Set Design (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Snoop Dogg (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Stalley (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Ty Dolla $ign (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Yandel (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Estelle (HBO)
Game of Thrones Season 5: Trailer #2 - The Wheel (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Raquel Sofia
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Kap G
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Talib Kweli
Game of Thrones Season 5: Artisan Piece #1: The Weapons of Dorne (HBO)
Game of Thrones Season 5: Catch The Throne Mixtape Volume II: Anthrax
Game of Thrones Season 5: The Sight: Brienne and Podrick (HBO)
Game of Thrones Season 5: The Sight: Jon Snow and Mance (HBO)
Game of Thrones: Blooper Reel #2 (HBO)
Game of Thrones: Will Simpson Drawing Storyboards (HBO)
Game of Thrones Season 5: A Day in the Life (HBO)
Game of Thrones Season 5: Day in the Life (HBO)
Comparing those lists, in addition to [Private video]s, the playlist on YouTube also seems to contain duplicate videos:

YoutubeExplode actually ignores duplicates as part of its parsing process: https://github.com/Tyrrrz/YoutubeExplode/blob/ed9c29c1cc81ec1498d3b54714d171ac9a850c0a/YoutubeExplode/YoutubeClient.Playlist.cs#L61-L66
As ironic as it is, the list of videos returned by YoutubeExplode is more accurate than what's returned by YouTube and its API. :)
When I extract the list from https://www.youtube.com/playlist?list=PLkLimRXN6NKw7zx3_NBUmW6qQrHMROlUC, I just get 299 videos but it actually has 358 videos. Can you please take a look?
@zjjohncq something is indeed really weird going on. It looks like it successfully gets the first 200 videos, then asks YouTube for the next batch of videos, but YouTube returns 100 videos from the previous batch and 100 new videos, then it asks for the next set of videos, but YouTube returns all 200 videos from the first batch... Will have to take a look after #229 is resolved.
Thank you very much for the response. Looking forward to solving it sooner.
Get Outlook for Androidhttps://aka.ms/ghei36
From: Alexey Golub notifications@github.com
Sent: Sunday, April 21, 2019 11:39:59 AM
To: Tyrrrz/YoutubeExplode
Cc: zjjohncq; Mention
Subject: Re: [Tyrrrz/YoutubeExplode] GetPlaylistAsync() doesn't return all videos (#228)
@zjjohncqhttps://github.com/zjjohncq something is indeed really weird going on. It looks like it successfully gets the first 200 videos, then asks YouTube for the next batch of videos, but YouTube returns 100 videos from the previous batch and 100 new videos, then it asks for the next set of videos, but YouTube returns all 200 videos from the first batch... Will have to take a look after #229https://github.com/Tyrrrz/YoutubeExplode/issues/229 is resolved.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/Tyrrrz/YoutubeExplode/issues/228#issuecomment-485261345, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AL3S3DVMTVA7M6ULKDQL2WLPRSDE7ANCNFSM4HGOUGDA.
@zjjohncq it looks like all videos got deleted, do you have another example?
Will this one be in problem?
https://www.youtube.com/playlist?list=PLxWfrQ5a52rM5oaGkF0czZVUWygUZbKSu
Get Outlook for Androidhttps://aka.ms/ghei36
From: Alexey Golub notifications@github.com
Sent: Sunday, May 12, 2019 12:21:18 PM
To: Tyrrrz/YoutubeExplode
Cc: zjjohncq; Mention
Subject: Re: [Tyrrrz/YoutubeExplode] GetPlaylistAsync() doesn't return all videos (#228)
@zjjohncqhttps://github.com/zjjohncq it looks like all videos got deleted, do you have another example?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/Tyrrrz/YoutubeExplode/issues/228#issuecomment-491609212, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AL3S3DSQ7D57BANE4SNWGQ3PVA7X5ANCNFSM4HGOUGDA.
Or the one from same provider
https://www.youtube.com/playlist?list=PLwlvRCjxnv_kWGZ8ctpt8rHXzDoglf58n
Get Outlook for Androidhttps://aka.ms/ghei36
From: John Jackson
Sent: Monday, May 13, 2019 8:15:41 PM
To: Tyrrrz/YoutubeExplode; Tyrrrz/YoutubeExplode
Cc: Mention
Subject: Re: [Tyrrrz/YoutubeExplode] GetPlaylistAsync() doesn't return all videos (#228)
Will this one be in problem?
https://www.youtube.com/playlist?list=PLxWfrQ5a52rM5oaGkF0czZVUWygUZbKSu
Get Outlook for Androidhttps://aka.ms/ghei36
From: Alexey Golub notifications@github.com
Sent: Sunday, May 12, 2019 12:21:18 PM
To: Tyrrrz/YoutubeExplode
Cc: zjjohncq; Mention
Subject: Re: [Tyrrrz/YoutubeExplode] GetPlaylistAsync() doesn't return all videos (#228)
@zjjohncqhttps://github.com/zjjohncq it looks like all videos got deleted, do you have another example?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/Tyrrrz/YoutubeExplode/issues/228#issuecomment-491609212, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AL3S3DSQ7D57BANE4SNWGQ3PVA7X5ANCNFSM4HGOUGDA.
First playlist does seem like it's missing quite a few videos, second playlist is only missing 1 video (the other is private) which might be a duplicate. I'm not sure if it's possible to fix it, maybe that's just the way it's returned.
OK. So maybe we can reopen the ticket when the same problem happen because the list I saved is deleted by owner.
Thanks.
Get Outlook for Androidhttps://aka.ms/ghei36
From: Alexey Golub notifications@github.com
Sent: Tuesday, May 14, 2019 4:10:53 PM
To: Tyrrrz/YoutubeExplode
Cc: zjjohncq; Mention
Subject: Re: [Tyrrrz/YoutubeExplode] GetPlaylistAsync() doesn't return all videos (#228)
First playlist does seem like it's missing quite a few videos, second playlist is only missing 1 video (the other is private) which might be a duplicate. I'm not sure if it's possible to fix it, maybe that's just the way it's returned.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/Tyrrrz/YoutubeExplode/issues/228?email_source=notifications&email_token=AL3S3DQWR6JKH6N4PDGEWBLPVMME3A5CNFSM4HGOUGDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVMUU4Q#issuecomment-492391026, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AL3S3DW3QSXUEVRGDHYSWCTPVMME3ANCNFSM4HGOUGDA.
I found another playlist, that does not return all videos:
https://www.youtube.com/playlist?list=PL1AC584471FD4F040
The Playlist has 186 tracks, but the library only returns 126 tracks.
I figured out how list_ajax works for another project I did.
Basically it selects from the middle and will always return an array with 200 videos.
So index=101 will get videos 1-200, index=301 will get 201-400, index=501 will get 401-600 etc.
The problem that remains is how to get the leftover videos (assuming the playlist isn't a multiple of 200). If you set the index to the last video it will return the last 200 videos, but if you set the index to a number higher than the last video it will return videos 1-200 again.
This would be easy if you can get the playlist size from somewhere but I haven't found anything yet. Maybe someone here has an idea?
Hope this helps.
Intersting, @GitBoudewijn
It also gets more complictaed because the returned array has up to 200 videos, it can have fewer if the videos are private/deleted/blocked.
On top of that, I vaguely remember some larger playlists working correctly despite not having multiple of 200 videos, although it may have changed now.
Are you sure about that? I haven't seen it return less than 200 videos, except when the playlist is smaller than 200, but that doesn't matter since setting it to any index that doesn't exist will always return the first 200 videos.
I have made something to test it here:
https://jsfiddle.net/Lu1tewa9/
I have tried it with the list from https://github.com/Tyrrrz/YoutubeExplode/issues/228#issuecomment-498010985 and that works. Now we just have to test it with lists with duplicates or deleted videos.
I have definitely seen this before, hence the code being the way it is here: https://github.com/Tyrrrz/YoutubeExplode/blob/6087575fec0c5b9085d6e5d5c9f9f936393839b8/YoutubeExplode/YoutubeClient.Playlist.cs#L70-L91
I tested some more playlists with duplicates and private/deleted videos and found out how it works. Basically it selects 200 entries each time, but it won't return any video that's private or deleted (it doesn't care about duplicates). This doesn't effect the index in any way though.
Knowing this I came up with the following solution:
Start with index=101, then increase it by 100 each time until the returned array is the same as the first one. Then combine all of them together and remove any duplicates. If you somehow know the size of the playlist beforehand you can instead increase the index by 200 each time like I mentioned before, plus one extra time with index equal to the playlist size.
But will that approach work if there are e.g. 350 videos?
Of course: index=101 will get 1-200, index=201 will get 101-300, index=301 will get 151-350 and index=401 will get 1-200 again.
Uh, okay. This is super confusing, I have to say, not that it was exactly straightforward before :)
If you have time, please submit a PR with the fix.
Actually I've never used C# before so I'll leave that to you.:stuck_out_tongue: You can ask me if you need help with anything though.
Just keep in mind that it always wants to return 200 videos. A playlist with 350 videos would also work if you increase the index by 200 (index=101 gives 1-200, index=301 gives 151-350), but for example 250 videos wouldn't work since you're skipping over the rest (index=101 gives 1-200, index=301 gives 1-200). With increments of 100 you're never skipping over anything.
Of course the most efficient solution would be to get 200 videos at a time. But I guess you haven't discovered a way to get the size of a playlist from somewhere? (Maybe you can let the user enter it manually.)
It is theoretically possible to get the playlist size, but it's likely going to be a heavy HTTP request. I think going in chunks of 100 is fine, but I'll have to benchmark.
Do you mean by scraping _youtube.com/playlist_? Alternatively maybe it would be nice if the user could manually enter a size if they want to get the more efficient method.
Yeah. I suspect the user doesn't know the exact size beforehand.
Hmm I just thought of one more alternative method:
Start with index=101, increase it by 200 each time until you get the same array as the first one again, then do one more request with the index reduced by 100.
Here's a comparison for number of requests depending on the size of the playlist:
101, 201101, 201, 301101, 201, 301, 401101, 301, 201101, 301, 501, 401101, 301, 501, 701, 601By the way the maximum playlist size is 5000 so you can always stop there.
That's a solid idea. And thanks a lot for the insights. :)
No problem. I'm looking forward to seeing it working.:stuck_out_tongue: