heartleo

heartleo / subtrans

Public

使用 OpenAI API 翻译 SRT 字幕 - Translate SRT subtitle using OpenAI-compatible APIs

11
0
100% credibility
Found Mar 17, 2026 at 11 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Go
AI Summary

A tool for translating SRT subtitle files from one language to another using AI services.

How It Works

1
🔍 Spot a video needing better subtitles

You find a great movie or show, but the subtitles are in a foreign language you can't read.

2
💡 Discover the subtitle translator

You hear about a handy tool that uses smart AI to turn subtitles into your preferred language effortlessly.

3
📥 Grab the translation helper

Download the simple program to your computer and get it ready to use.

4
🔗 Link your AI helper

Connect it to an AI service by sharing your private access code so it can understand and translate.

5
Pick file and new language

Choose your subtitle file and tell it the language you want, like English or French.

6
▶️ Launch the magic

Press start, and it works through the subtitles in smart chunks, fixing any misses automatically.

Watch with perfect subtitles

Load the new subtitles into your video player and enjoy the story as if it was made for you.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 11 to 11 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is subtrans?

subtrans translates SRT subtitle files to any ISO 639-1 language using OpenAI-compatible APIs, batching lines intelligently to cut openai api costs while preserving timing and structure. Built in Go, it runs as a CLI tool (subtrans-cli input.srt -l fr), embeddable library, or HTTP server with SSE streaming for real-time output. Handles bilingual results, custom prompts, and retries missing lines, turning raw subs into ready-to-use files fast.

Why is it gaining traction?

Sentence-aware batching (default 30 lines) and auto-retries minimize openai api pricing hits and failures, unlike basic scripts that burn tokens inefficiently—pair with cheaper providers via custom base URLs from openai api docs. SSE endpoints stream progress for apps, and options like temperature or model overrides (gpt-4o, etc.) fit workflows without lock-in. Devs dig the no-fuss setup: env vars for openai api key, models, and login-free proxies.

Who should use this?

Video editors localizing films or YouTube content, backend devs adding subtitle translation to streaming services, or script kiddies dubbing foreign media without clunky UIs. Ideal for batch jobs in CI via openai github action or integrating into Python/TS apps via the Go lib.

Verdict

Solid niche pick for SRT tasks despite 1.0% credibility score and 11 stars—bilingual docs and MIT license make it approachable, but low maturity means vet outputs and watch for edge cases on long files. Test with your openai api keys first.

(178 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.