twlite / youtube-sr

A dead-simple youtube metadata scraper
https://npmjs.com/package/youtube-sr
MIT License
113 stars 16 forks source link

Playlist videos #20

Closed mpirescarvalho closed 3 years ago

mpirescarvalho commented 3 years ago

It's possible to fetch more than 100 videos in a playlist?

This is the code I'm using: image Result: { videoCount: 551, actualVideos: 100 }

I saw that the limit defaults to 100, but I couldn't get more than that. I also tried with others limits values such as: .getPlaylist(playlistUrl, { limit: 0 }) .getPlaylist(playlistUrl, { limit: undefined }) .getPlaylist(playlistUrl)

twlite commented 3 years ago

with this package, I don't think it is possible to get more than 100 items :thinking:

however, you can use ytpl which is focused on youtube playlists parsing

Also I will try to fix this when I'm free

twlite commented 3 years ago

I have added Playlist.next() and Playlist.fetch() methods to solve this in v4.0.10. The next method returns next 100 items whereas fetch fetches every possible items (slow).

twlite commented 3 years ago

@mpirescarvalho is lazy loading playlist with Playlist.next() okay for you?

mpirescarvalho commented 3 years ago

I haven't tested it yet, but I'll do it by tomorrow.