[GH-ISSUE #168] get_library_songs not returning the number of songs in limit parameter for me #129

Closed
opened 2026-02-27 22:08:11 +03:00 by kerem · 1 comment
Owner

Originally created by @aa-dank on GitHub (Feb 7, 2021).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/168

Library of More than 30k songs from GPM. get_library_songs is not behaving as expected:
Screen Shot 2021-02-06 at 9 42 48 PM

What can I provide to help with this issue?

Originally created by @aa-dank on GitHub (Feb 7, 2021). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/168 Library of More than 30k songs from GPM. get_library_songs is not behaving as expected: ![Screen Shot 2021-02-06 at 9 42 48 PM](https://user-images.githubusercontent.com/4827545/107139336-43cd9e80-68cf-11eb-92ae-7cb53d335d49.png) What can I provide to help with this issue?
kerem closed this issue 2026-02-27 22:08:11 +03:00
Author
Owner

@sigma67 commented on GitHub (Feb 7, 2021):

It's a well-known server-side problem, see for example #52, #155. Perhaps should add this to the FAQ at this point.

  • YTMusic will usually return less than the requested number of songs because the endpoint is flaky
  • ytmusicapi will request continuations until it has reached at least the number of songs you requested, but it will return all songs that have been returned by YTMusic (explains 222 results for 200 requested)
  • you can only request in increments of 25 (explains 23 results)
  • since the endpoint is so flaky, it seems impossible to return the entire library at this point. we even added the param validate_responses in #52 to retry requests until the API returns the actual amount of 25 songs for that continuation (you can try that). But even then it sometimes returns less

If you can figure out some way to get around this issue please let us know.

<!-- gh-comment-id:774636129 --> @sigma67 commented on GitHub (Feb 7, 2021): It's a well-known server-side problem, see for example #52, #155. Perhaps should add this to the FAQ at this point. - YTMusic will usually return less than the requested number of songs because the endpoint is flaky - ytmusicapi will request continuations until it has reached at least the number of songs you requested, but it will return all songs that have been returned by YTMusic (explains 222 results for 200 requested) - you can only request in increments of 25 (explains 23 results) - since the endpoint is so flaky, it seems impossible to return the entire library at this point. we even added the param `validate_responses` in #52 to retry requests until the API returns the actual amount of 25 songs for that continuation (you can try that). But even then it sometimes returns less If you can figure out some way to get around this issue please let us know.
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#129
No description provided.