[GH-ISSUE #142] Add maximum limit parameter to get_watch_playlist() #108

Closed
opened 2026-02-27 22:08:04 +03:00 by kerem · 3 comments
Owner

Originally created by @Conobi on GitHub (Jan 4, 2021).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/142

Hi,
The get_watch_playlist() function has a weird limit function, which only set a minimum limit of items to get. It would be great to implement a maximum limit function that works like other ytmusic functions, limiting the number of items to get.

Originally created by @Conobi on GitHub (Jan 4, 2021). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/142 Hi, The get_watch_playlist() function has a weird limit function, which only set a minimum limit of items to get. It would be great to implement a maximum limit function that works like other ytmusic functions, limiting the number of items to get.
kerem closed this issue 2026-02-27 22:08:05 +03:00
Author
Owner

@sigma67 commented on GitHub (Jan 5, 2021):

No, that's not how it works. If you put limit=50 as a parameter, you will get at least 50 items returned, unless there is some error with YouTube's API. Can you provide the function call you used?

<!-- gh-comment-id:754785730 --> @sigma67 commented on GitHub (Jan 5, 2021): No, that's not how it works. If you put limit=50 as a parameter, you will get at least 50 items returned, unless there is some error with YouTube's API. Can you provide the function call you used?
Author
Owner

@Conobi commented on GitHub (Jan 5, 2021):

No, that's not how it works. If you put limit=50 as a parameter, you will get at least 50 items returned, unless there is some error with YouTube's API. Can you provide the function call you used?

Sorry, maybe my issue wasn't clear. I don't have an issue with limit=50, it is just that it would be useful to also have a parameter to set a maximum of items to get when doing the request. For example, the parameter max_limit=10 on get_watch_playlist() function to only get the 10 first results.

<!-- gh-comment-id:754789465 --> @Conobi commented on GitHub (Jan 5, 2021): > No, that's not how it works. If you put limit=50 as a parameter, you will get at least 50 items returned, unless there is some error with YouTube's API. Can you provide the function call you used? Sorry, maybe my issue wasn't clear. I don't have an issue with `limit=50`, it is just that it would be useful to also have a parameter to set a maximum of items to get when doing the request. For example, the parameter `max_limit=10` on `get_watch_playlist()` function to only get the 10 first results.
Author
Owner

@sigma67 commented on GitHub (Jan 5, 2021):

Oh, but that's not how any of this API works. The YouTube Music API always provides a fixed set of results (in this case 25), and you can get more if you need more by setting a higher limit. This library will perform the corresponding calls to get them from the API. You can only do increments of 25, that's how the API works.

If you only want 10, you can easily subset the response in python:

playlist = get_watch_playlist(videoId)
first_ten = playlist['tracks'][:10]
<!-- gh-comment-id:754832904 --> @sigma67 commented on GitHub (Jan 5, 2021): Oh, but that's not how any of this API works. The YouTube Music API always provides a fixed set of results (in this case 25), and you can get more if you need more by setting a higher limit. This library will perform the corresponding calls to get them from the API. You can only do increments of 25, that's how the API works. If you only want 10, you can easily subset the response in python: ```python playlist = get_watch_playlist(videoId) first_ten = playlist['tracks'][:10] ```
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#108
No description provided.