YoutubeExplode icon indicating copy to clipboard operation
YoutubeExplode copied to clipboard

`Playlists.GetVideosAsync` does not return all videos of a playlist

Open fiso64 opened this issue 2 years ago • 1 comments

Version

v6.3.6

Platform

.NET 6.0 / Windows 10

Steps to reproduce

youtube.Playlists.GetVideosAsync("https://www.youtube.com/playlist?list=PLI_eFW8NAFzYAXZ5DrU6E6mQ_XfhaLBUX")

Details

GetVideosAsync only returns the first ~900 videos from https://www.youtube.com/playlist?list=PLI_eFW8NAFzYAXZ5DrU6E6mQ_XfhaLBUX. The official api returns ~4500 videos of which about 500 are duplicates.

Checklist

  • [X] I have looked through existing issues to make sure that this bug has not been reported before
  • [X] I have provided a descriptive title for this issue
  • [X] I have made sure that that this bug is reproducible on the latest version of the package
  • [X] I have provided all the information needed to reproduce this bug as efficiently as possible
  • [ ] I have sponsored this project

fiso64 avatar Nov 04 '23 12:11 fiso64

I did a little research for this issue: At the moment of creating this comment, there were 4636 videos in playlist, according to YouTube. Service TuneMyMusic exported to CSV file 4531 videos (so on this step we have 105 videos removed, probably due to removed or privated videos). If we remove duplicates in Excel, there are 4074 unique videos.

Also, when I commented 109 and 110 lines in PlaylistClient.cs I ran into situation that code can reach to the last item of playlist, but after that it repeats fetching last videos from playlist endless. In addition to that, the value of lastVideoIndex was 4448 and it confuses me🫠

Here's .csv (original) and .xlsx (changed) files with content of playlist. Youtube_Explode_Test_Playlist.csv Youtube_Explode_Test_Playlist.xlsx

I hope it can be useful for anyone who will try to fix it.

UPD: I made minor changes that allowed me to rise number of items from function up to 3994. Some videos (example 1) are not available due to copyrights. I guess it's the best we can do right now.

hunterlan avatar Sep 30 '24 10:09 hunterlan