jackwener / jackwener/OpenCLI

[Bug]: youtube playlist returns EMPTY_RESULT — playlist items moved from playlistVideoRenderer to lockupViewModel

Open
#2,497 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
29.3k
Forks
2.9k
Avg merge
15h 36m
Merged PRs (30d)
70

Description

### Description

`opencli youtube playlist` returns `EMPTY_RESULT` for every public playlist I tried, while `youtube whoami` reports logged in and `opencli doctor` is all green.

The adapter's InnerTube call itself still works: `POST /youtubei/v1/browse` with `browseId: "VL"` returns HTTP 200 and the videos are in the payload. The item shape has changed, though. The adapter reads `itemSectionRenderer.contents[0].playlistVideoListRenderer.contents`, which no longer exists, so it gets `[]`. The string `playlistVideoRenderer` does not appear anywhere in the response.

`clis/youtube/playlist.js` on `main` is identical to the 1.8.7 release, so this is not fixed on `main` yet.

#### Old → new field mapping (verified against live responses)

| Purpose | Current adapter reads | Response now has |
|---|---|---|
| Item list | `itemSectionRenderer.contents[0].playlistVideoListRenderer.contents` | `itemSectionRenderer.contents` (items directly) |
| Item type | `playlistVideoRenderer` | `lockupViewModel` with `contentType: "LOCKUP_CONTENT_TYPE_VIDEO"` |
| Video ID | `videoId` | `contentId` |
| Title | `title.runs[0].text` | `metadata.lockupMetadataViewModel.title.content` |
| Channel | `shortBylineText.runs[0].text` | `metadata.lockupMetadataViewModel.metadata.contentMetadataViewModel.metadataRows[0].metadataParts[0].text.content` |
| Views / published | `videoInfo.runs[0]` / `videoInfo.runs[2]` | `metadataRows[1].metadataParts[0]` / `[1]` → `.text.content` |
| Duration | `lengthText.simpleText` | `contentImage.thumbnailViewModel.overlays[].thumbnailBottomOverlayViewModel.badges[].thumbnailBadgeViewModel.text` |
| Rank | `index.simpleText` | no equivalent field seen; list position works |
| Continuation token | last item → `continuationItemRenderer.continuationEndpoint.continuationCommand.token` | last item of `itemSectionRenderer.contents` → `continuationItemViewModel.continuationCommand.innertubeCommand.continuationCommand.token` |
| Continuation page items | `onResponseReceivedActions[0].appendContinuationItemsAction.continuationItems` | unchanged path; items are `lockupViewModel`, last item is the next `continuationItemViewModel` |

#### Pitfall: two continuation tokens

`sectionListRenderer.contents` is now `[itemSectionRenderer, continuationItemViewModel]`. The `continuationItemViewModel` that sits beside `itemSectionRenderer` has a different token. Requesting it returns only `responseContext` and `trackingParams`, with no items. The token that actually pages through videos is the one in the last element of `itemSectionRenderer.contents`.

#### Verification of the new paths

- A 446-episode playlist (`PLrAXtmErZgOdP_8GztsuKi9nrraNbKKp4`) pages as 100 / 100 / 100 / 100 / 46 using the inner token, giving 446 unique `contentId`s. That matches the count in the playlist header.
- A 6-video playlist returns all 6 videos on the first page. Its continuation request returns no items.

#### Scope note

`opencli youtube watch-later` still succeeds on 1.8.7, and it uses the same `extractPlaylistVideos` helper. That surface presumably still returns `playlistVideoRenderer`, so the fix should probably accept both shapes rather than replace the old one.

### Steps to Reproduce

1. `opencli youtube whoami` → `logged_in: true`
2. `opencli youtube playlist PLrAXtmErZgOdP_8GztsuKi9nrraNbKKp4 -f json`
3. See `EMPTY_RESULT`. Other public playlists, such as `PLAqhIrjkxbuWI23v9cThsA9GvCAUhRvKZ`, fail the same way.

### Expected Behavior

The command returns the playlist's videos with `rank`, `title`, `channel`, `duration`, `views`, `published` and `url`, and follows continuation up to `--limit`.

### OpenCLI Version

1.8.7 (latest on npm). Browser Bridge extension 1.0.23.

### Node.js Version

Other (v24.16.0)

### Operating System

Linux

### Logs / Screenshots

```shell
$ opencli youtube playlist PLrAXtmErZgOdP_8GztsuKi9nrraNbKKp4 --limit 5 -f json -v
ok: false
error:
code: EMPTY_RESULT
message: youtube playlist returned no data
help: The page structure may have changed, or you may need to log in
exitCode: 66
stack: |-
EmptyResultError: youtube playlist returned no data
at Object.func (file:///usr/lib/node_modules/@jackwener/opencli/clis/youtube/playlist.js:92:19)
```

`OPENCLI_DIAGNOSTIC=1` did not emit a RepairContext for this failure; stderr only contained the error block above.

Contributor guide

Open the contributing guide

Research direction

Start in clis/youtube/playlist.js, especially the extractPlaylistVideos helper and the continuation handling around the reported failure at line 92. Reproduce with the documented opencli youtube playlist command and inspect the live browse response paths described in the issue. Done means public playlists return video metadata and follow the inner continuation token, while watch-later's existing shape remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.