question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GetPlaylistAsync() doesn't return all videos

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:31 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
GitBoudewijncommented, Jun 23, 2019

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.)

1reaction
GitBoudewijncommented, Jun 23, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found