[GH-ISSUE #778] Validated continuations for playlists #498

Open
opened 2026-02-27 23:01:07 +03:00 by kerem · 4 comments
Owner

Originally created by @Pachandre on GitHub (Jun 19, 2025).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/778

Is your feature request related to a problem? Please describe.
Yes. The get_album() method has a limit parameter, but it only limits how many tracks are retrieved starting from the beginning of the playlist. This becomes inefficient when dealing with large playlists. Setting limit=None doesn't fetch all tracks either (possibly due to a YouTube-imposed limit); I only get 1914 out of 2054 tracks of my liked songs playlist

Describe the solution you'd like
It would be helpful to have support for pagination via offset and count parameters (or similar). For example, to retrieve tracks in batches, one could first request offset=0, count=100, then offset=100, count=100, and so on. This would make it easier to process large playlists incrementally and avoid performance issues

Describe alternatives you've considered
None that are practical or reliable - manually adjusting the limit and re-requesting from the start is inefficient and doesn't solve the problem

Additional context
This feature would be especially useful for users trying to fully export or analyze large playlists

Originally created by @Pachandre on GitHub (Jun 19, 2025). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/778 **Is your feature request related to a problem? Please describe.** Yes. The `get_album()` method has a `limit` parameter, but it only limits how many tracks are retrieved starting from the beginning of the playlist. This becomes inefficient when dealing with large playlists. Setting `limit=None` doesn't fetch all tracks either (possibly due to a YouTube-imposed limit); I only get 1914 out of 2054 tracks of my liked songs playlist **Describe the solution you'd like** It would be helpful to have support for pagination via `offset` and `count` parameters (or similar). For example, to retrieve tracks in batches, one could first request `offset=0, count=100`, then `offset=100, count=100`, and so on. This would make it easier to process large playlists incrementally and avoid performance issues **Describe alternatives you've considered** None that are practical or reliable - manually adjusting the limit and re-requesting from the start is inefficient and doesn't solve the problem **Additional context** This feature would be especially useful for users trying to fully export or analyze large playlists
Author
Owner

@sigma67 commented on GitHub (Jun 20, 2025):

Something like this is already implemented, but only for get_library_songs. Feel free to send a PR for the function you would like (I assume get_playlist).

github.com/sigma67/ytmusicapi@445833f420/ytmusicapi/mixins/library.py (L108)

"Yes. The get_album() method has a limit parameter, but it only limits how many tracks are retrieved starting from the beginning of the playlist. This becomes inefficient when dealing with large playlists."

This makes no sense to me. Why are you using get_album to fetch playlists?

<!-- gh-comment-id:2990254192 --> @sigma67 commented on GitHub (Jun 20, 2025): Something like this is already implemented, but only for `get_library_songs`. Feel free to send a PR for the function you would like (I assume `get_playlist`). https://github.com/sigma67/ytmusicapi/blob/445833f4208a0a859c4293b7ae4f787bb9179ca7/ytmusicapi/mixins/library.py#L108 "Yes. The get_album() method has a limit parameter, but it only limits how many tracks are retrieved starting from the beginning of the playlist. This becomes inefficient when dealing with large playlists." This makes no sense to me. Why are you using `get_album` to fetch playlists?
Author
Owner

@Pachandre commented on GitHub (Jun 20, 2025):

This makes no sense to me. Why are you using get_album to fetch playlists?

My bad, meant to write get_playlist

<!-- gh-comment-id:2991495768 --> @Pachandre commented on GitHub (Jun 20, 2025): > This makes no sense to me. Why are you using `get_album` to fetch playlists? My bad, meant to write `get_playlist`
Author
Owner

@lovegaoshi commented on GitHub (Jul 3, 2025):

im happy to be corrected but i doubt an offset parameter even exists to begin with.

<!-- gh-comment-id:3033810845 --> @lovegaoshi commented on GitHub (Jul 3, 2025): im happy to be corrected but i doubt an offset parameter even exists to begin with.
Author
Owner

@sigma67 commented on GitHub (Jul 4, 2025):

It doesn't, the approach is too keep retrying until you have the expected amount

<!-- gh-comment-id:3034598955 --> @sigma67 commented on GitHub (Jul 4, 2025): It doesn't, the approach is too keep retrying until you have the expected amount
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#498
No description provided.