mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #142] Add maximum limit parameter to get_watch_playlist() #108
Labels
No labels
a/b
bug
documentation
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
yt-error
yt-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ytmusicapi#108
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
@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?
@Conobi commented on GitHub (Jan 5, 2021):
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 parametermax_limit=10onget_watch_playlist()function to only get the 10 first results.@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: