feat: add validated continuations for get_playlist (#778)#953
Open
Locko2901 wants to merge 2 commits into
Open
feat: add validated continuations for get_playlist (#778)#953Locko2901 wants to merge 2 commits into
Locko2901 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in retry/validation mechanism for playlist continuations to improve completeness when YouTube Music returns short continuation pages, and adds test coverage for the new continuation behavior and the new get_playlist(validate_responses=...) flag.
Changes:
- Added
validate_responsesflag toPlaylistsMixin.get_playlist, using a validated continuation strategy when enabled. - Implemented
get_validated_continuations_2025to retry short continuation pages up to a retry limit. - Added unit tests for validated continuations and an OAuth-backed playlist test for the new flag (plus an error-case test when
trackCountis unavailable).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ytmusicapi/mixins/playlists.py | Adds validate_responses parameter and routes playlist track continuation through validated retries when enabled. |
| ytmusicapi/continuations.py | Introduces validated continuation retrieval for the 2025 browse-continuation format and generalizes retry helper typing. |
| tests/test_continuations.py | Adds unit tests covering retry behavior, retry caps, and stopping at limit for validated continuations. |
| tests/mixins/test_playlists.py | Adds an OAuth-backed test for validating large playlist retrieval and a no-trackCount error case. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #778
Adds an opt-in
validate_responsesflag toget_playlist, same asget_library_songsalready has. When enabled, short continuationpages are retried until complete.
get_validated_continuations_2025incontinuations.pyYTMusicUserErrorwhen neithertrackCountnorlimitis known