fix(youtube): fall back to Videos tab when Home tab has no videos#1109
Merged
jackwener merged 2 commits intojackwener:mainfrom Apr 21, 2026
Merged
Conversation
…ckwener#1108) Some channels have no video shelves on their Home tab, causing `opencli youtube channel <id>` to return an empty `recent_videos` list even though the channel has videos visible in the browser. When the Home tab extraction finds zero videos, the command now makes a second InnerTube browse request to the Videos tab and extracts from its richGridRenderer format.
luxiaolei
pushed a commit
to luxiaolei/OpenCLI
that referenced
this pull request
Apr 22, 2026
…ckwener#1109) * fix(youtube): fall back to Videos tab when Home tab has no videos (jackwener#1108) Some channels have no video shelves on their Home tab, causing `opencli youtube channel <id>` to return an empty `recent_videos` list even though the channel has videos visible in the browser. When the Home tab extraction finds zero videos, the command now makes a second InnerTube browse request to the Videos tab and extracts from its richGridRenderer format. * fix(youtube): make Videos tab fallback locale-safe --------- Co-authored-by: jackwener <jakevingoo@gmail.com> (cherry picked from commit b3db955)
This was referenced Apr 24, 2026
jackwener
added a commit
that referenced
this pull request
Apr 27, 2026
…ube response (#1164) * fix(youtube): channel videos-tab fallback reads wrong tab from InnerTube response After PR #1109, `opencli youtube channel <id>` still returns empty `recent_videos` for channels whose Home tab is empty AND whose InnerTube `/youtubei/v1/browse` response includes multiple tabs. Root cause: the fallback fetch sends a browse request with the Videos tab's `params`. The response, however, includes ALL tabs (Home, Videos, Shorts, ...), with only the requested tab marked `selected: true`. The existing code reads `tabs?.[0]?.tabRenderer?.content?.richGridRenderer?.contents` — for multi-tab responses `tabs[0]` is Home (empty), so `richGrid` ends up `[]` and `recentVideos` stays empty. PR #1109's test channels happened to return single-tab lists with Videos at index 0, masking the bug. Fix: find the tab with `selected: true` instead of assuming `tabs[0]`. Reproducer: `opencli youtube channel UC44DSuDgw7_qccvZzIK3Jpg` (杀鱼伟-Vi, ~3.1K subs, posts daily). Returns 0 videos pre-patch, 30+ videos post-patch. `npm run typecheck` clean, `npm test` passes (1952/1952). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(youtube): preserve videos tab fallback --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: jackwener <jakevingoo@gmail.com>
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.
Problem
opencli youtube channel <id>returns an emptyrecent_videoslist for some channels that have videos visible in the browser (Closes #1108).Root Cause
The command only extracts videos from the Home tab (
tabs.find(t => t.tabRenderer?.selected)). Some channels don't have video shelves on their Home tab — they may have a minimal or empty Home layout — so the extraction finds nothing.Fix
When the Home tab yields zero videos, the command now:
tabsarray (tabRenderer.title === 'Videos')browseEndpoint.paramsrichGridRendererformat used by the Videos tabThis is a pure fallback — channels that already show videos on their Home tab are unaffected.
Testing
npx tsc --noEmit— cleannpm test— all 1695 tests pass (222 files)clis/youtube/channel.jsmodified (+29 lines)