Skip to content

feat(subtitles): implement subtitle translation proxy support - #3176

Open
nutine wants to merge 1 commit into
recloudstream:masterfrom
nutine:feat/ai-subtitle-translation
Open

nutine wants to merge 1 commit into
recloudstream:masterfrom
nutine:feat/ai-subtitle-translation

Conversation

@nutine

@nutine nutine commented Sep 13, 2026

Copy link
Copy Markdown

Adds support for on-the-fly subtitle translation using an external translation proxy server.

Instead of embedding heavy translation logic, vendor APIs, or keys into the app, this keeps the client completely decoupled:

  • Users can set a translation proxy URL in Player Subtitles settings.
  • Selecting "Translate subtitles" in the player lets you pick a target language.
  • The app builds a proxied URL (<proxy>/translate?url=<sub_url>&target=<lang>) and passes it directly to the player as a standard WebVTT subtitle track.
  • The proxy server downloads the subtitle, translates it, and streams back WebVTT.

An open-source reference proxy implementation is available here:
https://github.com/nutine/cloudstream-subtitle-proxy

Tested with local and remote proxy servers on Android 13.


AI Policy disclosure: An LLM was used to assist in drafting boilerplate, but the architecture, code refactoring, and integration were implemented, verified, and tested manually.

@Bnyro

Bnyro commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Please read the AI Policy. You didn't even write the PR description yourself...

I also don't think that this should be implemented directly on the client, that looks extremely ugly. The only solid way to implement this if there's a dedicated server / proxy that can translate subtitles so that the proxied URL can just be passed to the player instead of the original subtitle URL.

@nutine nutine closed this Sep 16, 2026
@nutine nutine reopened this Sep 16, 2026
@nutine
nutine force-pushed the feat/ai-subtitle-translation branch from 9d6250e to 79b93a7 Compare September 16, 2026 17:21
@nutine nutine changed the title feat(subtitles): add on-the-fly Gemini AI subtitle translation with disk caching feat(subtitles): implement subtitle translation proxy support Sep 16, 2026
@nutine

nutine commented Sep 16, 2026

Copy link
Copy Markdown
Author

You're completely right about decoupling the client from direct LLM logic — putting vendor API calls and prompt batching directly into the Android app was messy.

I've refactored this PR according to your suggestion:

  1. The client now only knows about a configurable subtitle translation proxy URL (in Subtitles settings).
  2. When a user requests translation in the player, it simply builds the proxied URL (<proxy>/translate?url=<sub_url>&target=<lang>) and hands it to addAndSelectSubtitles as a regular WebVTT track.
  3. The client diff is now minimal (~140 lines total, no LLM SDKs, no batching or parsing hacks in the player).
  4. I've also published a reference open-source proxy implementation here that anyone can run/host: https://github.com/nutine/cloudstream-subtitle-proxy

Also updated the description and added the AI disclosure per the policy. Let me know if this looks cleaner!

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.

2 participants