Use ANDROID_SDKLESS client with TV fallback - #3
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
youtubekit-server | a909684 | Commit Preview URL Branch Preview URL |
Jan 19 2026, 11:08 PM |
📝 WalkthroughWalkthroughAdds support for a new Android SDK-less Innertube client type. The youtubei.js dependency is updated to reference a GitHub branch featuring this client, a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/youtube/service.ts (1)
244-252: Implement true fallback instead of always querying both clients.Right now both clients are always queried and merged, which doesn’t match “TV fallback” semantics and can increase latency/duplicate streams. Prefer trying
ANDROID_SDKLESSfirst and only falling back toTVon error or empty results.🔧 Suggested fallback logic
- private async getStreams(innertube: Innertube): Promise<RemoteStream[]> { - const clients: AvailableInnertubeClient[] = ['ANDROID_SDKLESS', 'TV']; - // const clients: AvailableInnertubeClient[] = ['WEB_EMBEDDED']; - let allStreams: RemoteStream[] = []; - - for (const client of clients) { - try { - const streams = await this.getStreamsForClient(innertube, client); - allStreams = allStreams.concat(streams); - } catch (error) { - console.error(`Failed to get streams for client ${client}:`, error); - } - } - - // TODO: remove duplicate itags - // TODO: parallelize it - - return allStreams; - } + private async getStreams(innertube: Innertube): Promise<RemoteStream[]> { + let streams: RemoteStream[] = []; + try { + streams = await this.getStreamsForClient(innertube, 'ANDROID_SDKLESS'); + } catch (error) { + console.error('Failed to get streams for client ANDROID_SDKLESS:', error); + } + + if (streams.length === 0) { + try { + streams = await this.getStreamsForClient(innertube, 'TV'); + } catch (error) { + console.error('Failed to get streams for client TV:', error); + } + } + + return streams; + }
🤖 Fix all issues with AI agents
In `@package.json`:
- Around line 19-20: Confirm whether the
"github:alexeichhorn/YouTube.js#feat/android-sdkless-client" entry in
package.json is an intended private fork or a mistaken reference to the upstream
LuanRT/YouTube.js, and then replace the branch-style GitHub reference with a
pinned source (either the correct repo "LuanRT/YouTube.js" or the verified fork)
at a specific commit SHA or tag; update the "youtubei.js" dependency value
accordingly in package.json so installs use a reproducible, immutable reference
rather than a branch ref.
| "quickjs-emscripten": "^0.31.0", | ||
| "youtubei.js": "^16.0.0" | ||
| "youtubei.js": "github:alexeichhorn/YouTube.js#feat/android-sdkless-client" |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
youtubei.js repository alexeichhorn YouTube.js feat/android-sdkless-client branch
💡 Result:
I couldn't find a GitHub repository or branch matching "alexeichhorn / youtubei.js" or a branch named "feat/android-sdkless-client". I found alexeichhorn’s YouTubeKit repo (Swift) and the main YouTube.js (youtubei.js) project (LuanRT), but no fork or branch by that name. Sources: GitHub listing for alexeichhorn/YouTubeKit [1] and the YouTube.js (youtubei.js) repo (LuanRT) [2].
If you have a direct GitHub URL or more details (exact username spelling or repo owner), share it and I’ll look again.
Sources:
[1] https://github.com/alexeichhorn/YouTubeKit
[2] https://github.com/LuanRT/YouTube.js
🌐 Web query:
youtubei.js ANDROID_SDKLESS client releases tags commits
💡 Result:
Here are the places that match your query and where you can find releases/tags/commits related to the Android (sdkless) client for youtubei.js / InnerTube tooling:
- YouTube.js releases & tags (official repo) — release history and tags for youtubei.js. [1]
- The YouTube.js Constants (CLIENTS) page showing ANDROID client fields (SDK_VERSION, USER_AGENT, VERSION). [2]
- Example commit adding an "android_sdkless" client context in yt-dlp (shows a concrete INNERTUBE_CLIENT entry and clientVersion/userAgent used for an SDK-less Android client). [3]
Sources:
[1] GitHub — LuanRT/YouTube.js Releases & Tags.
[2] YouTube.js API / Constants — CLIENTS (ANDROID) (ytjs.dev).
[3] yt-dlp commit showing android_sdkless client context.
🌐 Web query:
site:github.com alexeichhorn YouTube.js releases tags
💡 Result:
I couldn't find any GitHub releases/tags for a repository named "YouTube.js" under the user alexeichhorn. The YouTube.js project with releases is LuanRT/YouTube.js (releases page). [1]
For reference, alexeichhorn's GitHub contains YouTubeKit and other repos (not YouTube.js). [2]
Sources:
- LuanRT/YouTube.js — Releases. [1]
- alexeichhorn GitHub (YouTubeKit). [2]
🏁 Script executed:
cat package.jsonRepository: alexeichhorn/YouTubeKit-Server
Length of output: 581
🌐 Web query:
github.com/alexeichhorn/YouTube.js android sdkless
💡 Result:
Short answer: alexeichhorn does not have a repo named YouTube.js on GitHub. The YouTube.js (youtubei.js) project you probably mean is LuanRT/YouTube.js, and Alex Eichhorn maintains YouTubeKit (an iOS extractor), not an Android "sdkless" YouTube.js. [1][2]
Options if you want an Android, SDK-less approach:
- Use LuanRT/YouTube.js (youtubei.js) from a Node/JS layer or bundled V8/QuickJS to call InnerTube — repo and docs. [1]
- Use a WebView-based player library (iframe approach) for Android (no Google Play YouTube SDK required), e.g. android-youtube-player. [3]
- For native extraction on iOS see alexeichhorn/YouTubeKit. [2]
Sources:
- LuanRT / YouTube.js (youtubei.js) repo/docs. [1]
- alexeichhorn / YouTubeKit (iOS extractor). [2]
- PierfrancescoSoffritti / android-youtube-player (WebView/iframe approach — SDK-less). [3]
🌐 Web query:
"alexeichhorn/YouTube.js" fork
💡 Result:
Do you mean a fork of the GitHub repo "alexeichhorn/YouTube.js"? If so, do you want me to (pick one)
- list existing forks on GitHub, or
- create instructions to fork it yourself, or
- find a specific fork (most active/popular)?
Tell me which and I’ll search GitHub and return results with links.
Verify the GitHub fork and pin to a commit or tag.
The repository alexeichhorn/YouTube.js does not appear to exist publicly on GitHub. The official YouTube.js project is maintained at LuanRT/YouTube.js. Confirm whether this is a private fork, an incorrect reference, or if the dependency should point to a different source. Once verified, pin the dependency to a specific commit SHA or tag rather than a branch ref to ensure reproducible builds and reduce supply-chain risk.
🤖 Prompt for AI Agents
In `@package.json` around lines 19 - 20, Confirm whether the
"github:alexeichhorn/YouTube.js#feat/android-sdkless-client" entry in
package.json is an intended private fork or a mistaken reference to the upstream
LuanRT/YouTube.js, and then replace the branch-style GitHub reference with a
pinned source (either the correct repo "LuanRT/YouTube.js" or the verified fork)
at a specific commit SHA or tag; update the "youtubei.js" dependency value
accordingly in package.json so installs use a reproducible, immutable reference
rather than a branch ref.
There was a problem hiding this comment.
This is my own github fork
There was a problem hiding this comment.
@alexeichhorn, thank you for clarifying! Since this is your own fork, the dependency reference is perfectly valid. I apologize for the confusion—my initial concern was based on not finding the fork in public indexes.
Using a branch reference makes sense for active development. If you plan to merge this to production later, you might consider pinning to a specific commit SHA for reproducibility, but that's entirely up to your workflow preferences.
There was a problem hiding this comment.
The lockfile does that, doesn't it?
There was a problem hiding this comment.
@alexeichhorn, you're absolutely right! The lockfile does indeed pin the dependency to a specific commit SHA. When your package manager (npm, yarn, or pnpm) resolves the GitHub branch reference during installation, it records the exact commit SHA in the lockfile. This ensures reproducible builds across environments as long as the lockfile is committed to the repository.
My concern about reproducibility is fully addressed by this mechanism. Sorry for the noise on this one!
No description provided.