GetPlaylistAsync() doesn't return all videos
See original GitHub issueWhen 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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:31 (15 by maintainers)
Top Results From Across the Web
YouTube API v3 Search not returning all videos
The API call that you should make if you want to get the videos in a channel is a youtube.playlistItems.list() with the playlistId...
Read more >PlaylistItems: list | YouTube Data API
Returns a collection of playlist items that match the API request parameters. You can retrieve all of the playlist items in a specified ......
Read more >Search: list | YouTube Data API
It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials...
Read more >Understand limited data in YouTube Analytics
We want to give creators useful data to make informed decisions about their channel, but some data may be limited in YouTube Analytics....
Read more >Fix videos & games that won't play - Computer
Some video or game issues are caused by Chrome extensions, plugins, or something saved in your cache or browser data. ... Close the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Actually I’ve never used C# before so I’ll leave that to you.😛 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.)
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.