mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 15:26:01 +03:00
[PR #53] [MERGED] Fix for incomplete get_library_songs request #547
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#547
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?
📋 Pull Request Information
Original PR: https://github.com/sigma67/ytmusicapi/pull/53
Author: @czifumasa
Created: 8/1/2020
Status: ✅ Merged
Merged: 9/1/2020
Merged by: @sigma67
Base:
master← Head:master📝 Commits (2)
e432593Resend request when ytm returns invalid per_page count for get_library_songs6d8bbc0Added optional validate_reponses param to get_library_songs📊 Changes
3 files changed (+95 additions, -14 deletions)
View changed files
📝
ytmusicapi/mixins/library.py(+30 -14)📝
ytmusicapi/parsers/library.py(+11 -0)📝
ytmusicapi/parsers/utils.py(+54 -0)📄 Description
This is my attempt to fix #52.
When YTMusic sends incomplete response with less then per_page (25 songs), then request is retried till valid response or till max_retries number is reached. Usually after single retry, the response is valid. I know it's not the perfect solution, it costs performance to retry these request and complicates code a bit, but I think that more accurate results are better than fast ones.
resend_request_until_parsed_response_is_valid()is generic method and can be used to validate any request. Currently I fixed onlyget_library_songs call. Let me know, what you think about it. If you approve the solution, I will prepare another fix forget_playlist.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.