Skip to content

Use ANDROID_SDKLESS client with TV fallback - #3

Merged
alexeichhorn merged 1 commit into
cloudflare-workerfrom
feature/android-sdkless-client
Jan 19, 2026
Merged

alexeichhorn merged 1 commit into
cloudflare-workerfrom
feature/android-sdkless-client

Conversation

@alexeichhorn

Copy link
Copy Markdown
Owner

No description provided.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@alexeichhorn
alexeichhorn marked this pull request as ready for review January 19, 2026 23:09
@coderabbitai

coderabbitai Bot commented Jan 19, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds 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 ANDROID_SDKLESS client identifier is added to the AvailableInnertubeClient union type, and stream retrieval logic is modified to consider this client alongside existing options.

Changes

Cohort / File(s) Summary
Android SDK-less Client Support
package.json
Updated youtubei.js dependency from npm semver ^16.0.0 to GitHub reference github:alexeichhorn/YouTube.js#feat/android-sdkless-client
Android SDK-less Client Support
src/youtube/models/internal.ts
Added ANDROID_SDKLESS as new member to AvailableInnertubeClient union type
Android SDK-less Client Support
src/youtube/service.ts
Updated getStreams method to include ANDROID_SDKLESS client alongside TV when collecting available streams

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning No description was provided by the author, which is a significant omission for understanding the motivation and context of the changes. Add a description explaining why the ANDROID_SDKLESS client is being introduced, what problem it solves, and any relevant context about the implementation.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: using a new ANDROID_SDKLESS client with TV as a fallback option.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_SDKLESS first and only falling back to TV on 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.

Comment thread package.json
Comment on lines 19 to +20
"quickjs-emscripten": "^0.31.0",
"youtubei.js": "^16.0.0"
"youtubei.js": "github:alexeichhorn/YouTube.js#feat/android-sdkless-client"

@coderabbitai coderabbitai Bot Jan 19, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 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:

  1. YouTube.js releases & tags (official repo) — release history and tags for youtubei.js. [1]
  2. The YouTube.js Constants (CLIENTS) page showing ANDROID client fields (SDK_VERSION, USER_AGENT, VERSION). [2]
  3. 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.json

Repository: 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:

  1. LuanRT / YouTube.js (youtubei.js) repo/docs. [1]
  2. alexeichhorn / YouTubeKit (iOS extractor). [2]
  3. 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.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my own github fork

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lockfile does that, doesn't it?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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!

@alexeichhorn
alexeichhorn merged commit 7d14507 into cloudflare-worker Jan 19, 2026
3 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jun 12, 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.

1 participant