fix(innertube): resolve playlist pagination capping at 100 songs#2823
Merged
mostafaalagamy merged 1 commit intoMetrolistGroup:mainfrom Feb 14, 2026
Merged
Conversation
- Add fallback to check musicPlaylistShelfRenderer.continuations for the initial continuation token, not just inline ContinuationItemRenderer - Extract songs from musicPlaylistShelfContinuation.contents in continuation responses, which was previously ignored - Remove erroneous browseId="" from continuation browse requests, allowing it to default to null and be omitted from the JSON payload
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.
Summary
Fixes playlists being capped at 100 songs when syncing from YouTube Music by addressing three pagination bugs in the innertube playlist fetching logic.
Problem
Synced playlists only display the first ~100 songs, even when the YouTube Music playlist contains more. The root cause is that the pagination loop responsible for fetching subsequent pages of songs either never starts or terminates prematurely due to missing data extraction paths.
Changes
All changes are in
innertube/src/main/kotlin/com/metrolist/innertube/YouTube.kt.1. Missing continuation token source in
playlist()The initial playlist fetch only looked for the continuation token as an inline
ContinuationItemRendererinsidemusicPlaylistShelfRenderer.contents. YouTube's API can also return it inmusicPlaylistShelfRenderer.continuations(theList<Continuation>format). When it did,songsContinuationwasnulland the pagination loop incompleted()never executed.Added a
?:fallback to checkmusicPlaylistShelfRenderer.continuations.2. Missing song source in
playlistContinuation()Continuation responses were only checked for songs in
sectionListContinuationandonResponseReceivedActions, but not inmusicPlaylistShelfContinuation.contents— even though the next continuation token was already being extracted from that same object. When the API returned songs there, the result was an empty list, which terminated the loop.Added
musicPlaylistShelfContinuation.contentsas an additional song source.3. Invalid
browseIdin continuation requestsplaylistContinuation()passedbrowseId = ""instead of omitting it. Since the serializer only omitsnull(not empty strings), this sent"browseId": ""in the request body — unlike every other continuation function in the codebase, which correctly defaults tonull. This could cause the API to return an unexpected response format.Removed the explicit
browseId = ""parameter so it defaults tonulland is omitted from the JSON payload.