Skip to content

fix(innertube): resolve playlist pagination capping at 100 songs#2823

Merged
mostafaalagamy merged 1 commit intoMetrolistGroup:mainfrom
adrielGGmotion:fix-playlists
Feb 14, 2026
Merged

fix(innertube): resolve playlist pagination capping at 100 songs#2823
mostafaalagamy merged 1 commit intoMetrolistGroup:mainfrom
adrielGGmotion:fix-playlists

Conversation

@adrielGGmotion
Copy link
Contributor

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 ContinuationItemRenderer inside musicPlaylistShelfRenderer.contents. YouTube's API can also return it in musicPlaylistShelfRenderer.continuations (the List<Continuation> format). When it did, songsContinuation was null and the pagination loop in completed() never executed.
Added a ?: fallback to check musicPlaylistShelfRenderer.continuations.

2. Missing song source in playlistContinuation()

Continuation responses were only checked for songs in sectionListContinuation and onResponseReceivedActions, but not in musicPlaylistShelfContinuation.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.contents as an additional song source.

3. Invalid browseId in continuation requests

playlistContinuation() passed browseId = "" instead of omitting it. Since the serializer only omits null (not empty strings), this sent "browseId": "" in the request body — unlike every other continuation function in the codebase, which correctly defaults to null. This could cause the API to return an unexpected response format.
Removed the explicit browseId = "" parameter so it defaults to null and is omitted from the JSON payload.

- 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
@mostafaalagamy mostafaalagamy merged commit 4fa58f6 into MetrolistGroup:main Feb 14, 2026
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.

2 participants