Skip to content

feat: add validated continuations for get_playlist (#778)#953

Open
Locko2901 wants to merge 2 commits into
sigma67:mainfrom
Locko2901:validated-continuations-playlists
Open

feat: add validated continuations for get_playlist (#778)#953
Locko2901 wants to merge 2 commits into
sigma67:mainfrom
Locko2901:validated-continuations-playlists

Conversation

@Locko2901

Copy link
Copy Markdown

Closes #778

Adds an opt-in validate_responses flag to get_playlist, same as
get_library_songs already has. When enabled, short continuation
pages are retried until complete.

  • get_validated_continuations_2025 in continuations.py
  • raises YTMusicUserError when neither trackCount nor limit is known
  • added tests

Copilot AI review requested due to automatic review settings July 2, 2026 13:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_responses flag to PlaylistsMixin.get_playlist, using a validated continuation strategy when enabled.
  • Implemented get_validated_continuations_2025 to 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 trackCount is 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.

Comment thread ytmusicapi/mixins/playlists.py
Comment thread ytmusicapi/continuations.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validated continuations for playlists

2 participants