fix(youtube): Videos tab fallback misses lockupViewModel format#1733
Open
FSpark wants to merge 1 commit into
Open
fix(youtube): Videos tab fallback misses lockupViewModel format#1733FSpark wants to merge 1 commit into
FSpark wants to merge 1 commit into
Conversation
The Videos tab fallback (added in jackwener#1109, fixed in jackwener#1164) only handled the legacy `videoRenderer` format. Channels whose Videos tab returns the newer `lockupViewModel` format got zero videos despite having content. Extract `parseVideoItem()` as a shared helper that handles both formats, and reuse it in the Videos tab fallback. Add comprehensive tests for the new helper including serialization checks for browser injection. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.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
After #1164 landed,
opencli youtube channel <id>still returns emptyrecent_videosfor channels whose Home tab is empty AND whose Videos tab uses the newerlockupViewModelInnerTube format.Reproducer:
opencli youtube channel @Jett.franzen(~207K subs, 216 videos). Returns 0 videos despite the Videos tab being fully populated.Root cause
The Videos-tab fallback added in #1109 only parses
item.richItemRenderer?.content?.videoRenderer(the legacy format). Many channels now return the newerlockupViewModelformat from the Videos tab browse endpoint, which the fallback silently skips.Meanwhile, the Home tab extraction (lines 101-118) already handles
lockupViewModel, creating an inconsistency between the two code paths.Concrete shape on the reproducer channel:
Fix
Extract a shared
parseVideoItem()helper that handles bothlockupViewModelandvideoRendererformats, and use it in the Videos-tab fallback loop. This reuses the same parsing logic already proven in the Home tab path.Changes:
clis/youtube/channel.js: +32 lines (newparseVideoItemhelper, updated fallback)clis/youtube/channel.test.js: +6 test cases for the new helperVerification
npm test --project adapterpasses (3418 / 3418).🤖 Generated with Claude Code