Language / Χ©Χ€Χ: English | Χ’ΧΧ¨ΧΧͺ
Subtitles Done Right β from 1-Click Plex & BiDi Repair to Autonomous Multi-Agent AI Translation.
RightSub is a high-performance CLI suite and Python framework designed to repair, clean, synchronize, translate, and format subtitles for ANY movie or television series across Windows and macOS.
Whether you want to fix reversed question marks in Plex on your Apple TV, convert unreadable Windows-1255 CP1255 Hebrew gibberish to clean UTF-8, strip annoying [MUSIC PLAYING] noise cues, fix framerate sync drifts, or translate an entire TV season using AI agents, RightSub gives you a dead-simple, reliable workflow.
Got a video or subtitle file that needs fixing or translation? You only need one command.
Type rightsub auto and simply drag & drop the file or folder into your terminal:
rightsub auto "C:\Movies\Inception.he.srt"
:: Or for an entire TV season:
rightsub auto "C:\TV Shows\Breaking Bad Season 1"rightsub auto ~/Movies/Inception.he.srt
# Or for an entire TV season:
rightsub auto ~/Movies/Breaking_Bad_S01/- Hebrew Subtitle (
.srt): RightSub instantly fixes reversed punctuation (? ! .), converts legacy encodings to UTF-8, strips ads, and masters the file for Plex & Infuse. - Video File (
.mkv/.mp4): RightSub extracts embedded subtitles, transcribes audio if needed, and builds AI-ready translation waves. - Torrents & Seeding Protected (Seed-Safe): When encountering non-standard subtitles (e.g.
Movie.srt), RightSub creates a cleanMovie.he.srtcopy while leaving the original file 100% bit-for-bit intact so active torrent seeding is never broken. - Home Media Automation (Set-and-Forget): Plug RightSub into qBittorrent, Sonarr, Radarr, Bazarr, or Transmission to run seamlessly in the background without needing a heavy 24/7 daemon. See Home Media Integrations Guide.
RightSub is organized into two distinct paths:
No AI required. No API keys. Zero cloud bandwidth.
- Plex & Infuse BiDi Fix: Injects invisible Right-to-Left Marks (
\u200F/ RLM) so punctuation and dashes never flip to the wrong side on Apple TV, Android TV, LG WebOS, Infuse, and VLC. - Encoding Rescue: Automatically detects CP1255 / Windows-1255 / ISO-8859-8 and converts to modern UTF-8.
- SDH Cleaner: Strips hearing-impaired noise descriptors (
[CHEERING],βͺ Pop music βͺ) while strictly preserving dialogue timing. - Ad & Watermark Stripper: Removes release group spam, site URLs, and promotional lines.
# Windows:
rightsub fix-plex "C:\Movies\Season 01" --recursive --clean-ads
# macOS / Linux:
rightsub fix-plex ~/Movies/Season_01 --recursive --clean-adsTranslate entire movies or 24-episode seasons with full character context and zero hallucinations.
RightSub structures the translation process so you can use any AI model or assistant you already have:
-
Prepare Batches & Context:
rightsub auto "Movie.mkv"RightSub splits dialogue into optimal ~210-cue batches, resolves character genders via TMDb (e.g.
ΧΧͺ/ΧΧΧvsΧΧͺΧ/ΧΧΧ), and produces ready-to-use prompts. -
Translate with Your AI Assistant:
- Coding AI Agents: Antigravity, Claude Code, Cursor, Codex β paste the generated wave prompts.
- Free Local LLM (100% Offline): Run with Ollama using:
rightsub auto "Movie.mkv" --ollama
-
Auto-Merge & Validate: RightSub automatically merges translated JSON batches back into a pristine
.he.srtfile, enforces 1:1 line matching, and applies full BiDi formatting.
Key Integrations & Keywords:
qBittorrentβ’Sonarrβ’Radarrβ’Bazarrβ’Transmissionβ’Tautulli/Plexβ’Background Watchers & Daemonsβ’Seed-Safe
RightSub is engineered to integrate natively into automated home media and seedbox stacks in a 100% hands-off workflow.
- Retroactive Batch Fix (Run Once): Clean and master your entire existing media library:
# Windows: rightsub auto "C:\Media\TV Shows" # macOS / Linux: rightsub auto /Volumes/Media/TV_Shows
- Ongoing Event-Driven Ingress (Set-and-Forget): Attach RightSub to your downloaders or
*arrmanagers to process new media the millisecond it finishes downloading.
Unlike heavy background daemons that poll filesystems 24/7 and risk corrupting multi-gigabyte files while they are still being written, RightSub's Event-Driven Hook Architecture operates with:
- π‘οΈ Zero Race Conditions: Executes only on completed, hash-verified files.
- β‘ Zero Idle Overhead: 0% CPU and 0 MB RAM when idle.
- π Seed-Safe by Default: Duplicates into
.he.srt, leaving original downloaded torrent files 100% bit-for-bit intact so active seeding never breaks.
For containerized NAS environments (Unraid, TrueNAS SCALE, Synology DSM, Docker Compose) where running host scripts is impossible, RightSub includes a native HTTP Webhook server consuming under 15 MB RAM:
# Run standalone daemon:
rightsub serve --port 8775 --path-map "/data/media:/media"
# Or deploy via Docker Compose:
docker compose up -d- Sonarr Webhook URL:
http://rightsub:8775/webhook/sonarr(Triggers: On Download, On Upgrade) - Radarr Webhook URL:
http://rightsub:8775/webhook/radarr(Triggers: On Download, On Movie Imported) - Bazarr Webhook URL:
http://rightsub:8775/webhook/bazarr(Triggers: On Subtitles Download) - Automatic Path Translation:
PATH_MAP="/data/media:/media"bridges container volume differences.
π Read the full Home Media & Download Integrations Guide for copy-pasteable configurations for qBittorrent, Sonarr, Radarr, Bazarr, Transmission, and native OS Folder Watchers.
RightSub offers equal, first-class support for both Windows and macOS/Linux:
- Clone or Download the repository:
git clone https://github.com/omerninyo/RightSub.git cd RightSub - Run the Windows Installer:
Double-click
install.bat(or execute it in CMD):The installer verifies Python 3, installs dependencies frominstall.bat
requirements.txt, and prepares global wrappers. - Run from anywhere:
Use
rightsub.batorpython rightsub.py:rightsub auto "Movie.mkv"
Choose any of the following 3 options:
-
Option A: Official Homebrew Tap (Recommended for macOS): Instant 1-second installation via pre-packaged universal bottles (supports both Apple Silicon & Intel):
brew tap omerninyo/tap brew install rightsub
-
Option B: Fast Local Clone:
git clone https://github.com/omerninyo/RightSub.git cd RightSub ./install.shSymlinks
rightsubglobally to~/.local/bin/rightsub. -
Option C: One-Liner Remote Script:
curl -fsSL https://raw.githubusercontent.com/omerninyo/RightSub/main/install.sh | bash
# Auto-repair Hebrew subtitle (BiDi RLM, ad stripping, automatic backup):
rightsub auto "Movie.he.srt"
# Auto-process video file (extract/transcribe subtitles and build batches):
rightsub auto "Movie.mkv"
# 100% offline, free local translation using Ollama (Llama 3, Qwen):
rightsub auto "Movie.mkv" --ollama
# Auto-scan and process entire TV season or complete media library:
rightsub auto "/path/to/Season 01/"# Option A: Fix a single file in-place:
rightsub fix-plex "Movie.he.srt" --in-place
# Option B: Fix multiple specific files:
rightsub fix-plex "Ep01.he.srt" "Ep02.he.srt" "Ep03.he.srt" --in-place
# Option C: Preview changes safely on a whole folder (Dry Run):
rightsub fix-plex /path/to/TV_Shows/ --recursive --clean-ads --dry-run
# Option D: Apply in-place recursively with automatic backups (.srt.bak):
rightsub fix-plex /path/to/TV_Shows/ --recursive --in-place --clean-ads --backuprightsub extract "Movie.mkv" -o "Movie.en.srt" --lang engStretch subtitles extracted from PAL DVDs or European TV to match US Web-DL / BluRay rips:
rightsub adjust-fps "PAL_sub.srt" -o "synced_sub.srt"# 1. Generate translation batches and agent wave prompts:
rightsub prompt-gen "Episode01.en.srt" -t "Inception" -g "Sci-Fi Action"
# 2. Merge translated JSON batches into final Hebrew SRT with full SubRefine BiDi:
rightsub merge "Episode01.en.srt" "prompts_Inception" -o "Episode01.he.srt"
# 3. Run comprehensive Red Team QA audit:
rightsub qa "Episode01.en.srt" "Episode01.he.srt"Modernize and proofread an existing Hebrew subtitle without re-translating from scratch (preserves 85%β90% of intact lines):
# Option A: Polish existing Hebrew subtitle directly against media container:
rightsub polish "Star Wars (1977).mkv"
# Option B: Polish specific Hebrew subtitle against companion English master:
rightsub polish "Movie.he.srt" --en "Movie.en.srt"
# Option C: Dry run generating a Markdown diff report without altering files:
rightsub polish "Movie.he.srt" --diff-only
# Option D: In-place mastering with automatic seed-safe backup (.he.original.srt):
rightsub polish "Movie.he.srt" --in-place# 10-second interactive setup wizard for Gemini & TMDb API keys:
rightsub config
# End-to-end environment inspector (FFmpeg, Python, Gemini, TMDb, Quicksubs):
rightsub doctorFor developers and power users, RightSub cleanly separates high-level workflow commands from its two underlying core algorithmic engines:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RightSub CLI (rightsub) β
β extract Β· clean Β· fix-plex Β· sync Β· adjust-fps Β· split Β· merge Β· qa β
ββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββ
βΌ βΌ
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββ
β SubRefine Engine β β SubSwarm AI Engine β
β (Sanitization & BiDi Core) β β (Multi-Agent Orchestration) β
βββββββββββββββββββββββββββββββββββ€ βββββββββββββββββββββββββββββββββββββ€
β β’ SDH Hearing-Impaired Cleaner β β β’ Optimal SRT Chunker (~210 cues) β
β β’ CP1255 / ISO -> UTF-8 Auto β β β’ Character & Entity Bible Parser β
β β’ BiDi / RLM (U+200F) Injection β β β’ Dynamic Minimum Baseline: β
β β’ Cyrillic/Arabic Homoglyphs β β Gemini 3.5 Flash-Lite β
β β’ Hebrew Gershayim (Χ΄) Fix β β β’ Concurrent Wave Translation β
β β’ Ad & Promo Spam Stripper β β β’ 1:1 Block Alignment Guarantee β
β β’ Framerate (FPS) Stretcher β β β’ Red Team QA Zero-Hallucination β
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββ
- Zero-Reverse Punctuation on Plex & Infuse: Automatically injects invisible Right-to-Left Marks (
\u200F/ RLM) at line starts and trailing punctuation (?,!,.,:,-), preventing punctuation from flipping to the wrong side of the screen on Apple TV, Android TV, Infuse, and VLC. - Hearing-Impaired (SDH) Cleaner: Intelligently removes descriptive auditory noise like
[DOOR CLOSES],(CHEERING),βͺ Pop music βͺwhile strictly preserving dialogue timing blocks. - Auto-Charset & Mojibake Rescue: Detects legacy Hebrew encodings (Windows-1255 / CP1255 / ISO-8859-8) and seamlessly converts them into clean UTF-8.
- Homoglyph & Typography Repair: Normalizes accidental Cyrillic (
ΠΌ,Ρ,Ρ) and Arabic letters into native Hebrew characters. Automatically converts standard quotes in Hebrew acronyms into typographic gershayim (e.g.,Χ’Χ"ΧβΧ’ΧΧ΄Χ,ΧΧ¨Χ"ΧβΧΧ¨ΧΧ΄Χ). - Ad & Spam Stripper: Cleans watermark lines from release groups, Torec, OpenSubtitles, Wizdom, and Telegram channels.
- Concurrent Agent Waves: Splits subtitles into optimal batches (~210 cues per batch) to translate entire seasons (20+ episodes, 20,000+ lines) in minutes.
- Pre-Locked Translation Bible: Pre-extracts character names, legal/technical terms, and gender assignments to eliminate intra-season inconsistencies.
- 1:1 Alignment Guarantee: Every index and timing range matches the audio and English master file. Zero dropped cues, zero hallucinations.
- Zero-Cloud STT Ingestion: Powered by quicksubs (by Matt Birchler). Transcribes raw media on-device using Apple SpeechAnalyzer (Apple Silicon Neural Engine), OpenAI Whisper, or NVIDIA Parakeet with zero bandwidth and zero API costs.
- Audio-Guided Retiming: Extracts authoritative dialogue speech timestamps directly from the video file's audio track to re-align drifted, cut, or framerate-mismatched subtitles automatically.
- Deterministic Gender Mapping: Automatically resolves character genders and episodic guest stars via The Movie Database (TMDb) API, guaranteeing 100% accurate second-person Hebrew pronouns (
ΧΧͺ/ΧΧΧvsΧΧͺΧ/ΧΧΧ) with zero hallucinations. - Narrative Context & Dialect Priming: Injects episodic plot synopses, genre terms, and regional dialect guidance (e.g. British English idioms) directly into the translation prompts.
- Minimal Edit Distance Principle: Selectively proofreads and modernizes existing human subtitles, preserving 85%β90% of intact dialogue blocks and eliminating gratuitous cosmetic churn.
- Hierarchical Domain Knowledge Engine: 3-tier intelligent context classifier (TMDb metadata, title/franchise patterns, and offline lexical cue vocabulary fingerprinting) with dedicated domain packs (
SCI_FI,MILITARY,LEGAL,MEDICAL,FANTASY,UNIVERSAL_IDIOMS) and Bilingual Anchor Validation to prevent false positives across unrelated genres. - Forward Anticipation Drift Guard: Robust split-cue partitioning (
split_part) and real-time drift protection that strictly prevents language models from leaking or anticipating future dialogue lines, ensuring 100% timing alignment. - Network Storage (SMB/NAS) Timestamp Synchronization: Forces immediate kernel filesystem metadata flushes (
os.utime) on all mastered subtitles, diff audit reports, and backups to prevent macOS SMB clients from falling back to Apple's CoreFoundation epoch (2001-01-01). - Automated Markdown Diff Audit Reporting: Automatically outputs a detailed, cue-by-cue audit report (
_polish_diff.md) comparing original English, prior Hebrew, polished Hebrew, and explicit reasoning for every single modification.
| Command | Engine | Description | Windows Example | macOS / Linux Example |
|---|---|---|---|---|
auto |
All | Zero-flag autonomous runner for files, seasons, or directories | rightsub auto "Movie.mkv" |
rightsub auto "Movie.mkv" |
serve |
Daemon | Native Webhook daemon for Sonarr, Radarr, and Bazarr automation | rightsub serve --port 8775 |
rightsub serve --port 8775 |
polish |
SubRefine & AI | Semantic AI proofreading, canon harmonization & subtitle QC | rightsub polish "Star Wars.he.srt" |
rightsub polish "Star Wars.he.srt" |
translate-ollama |
SubSwarm | 100% offline local subtitle translation via Ollama | rightsub translate-ollama prompts |
rightsub translate-ollama prompts |
fix-plex |
SubRefine | Fix BiDi, RLM, punctuation, CP1255 encoding & ads | rightsub fix-plex ./Season1/ -r -i |
rightsub fix-plex ./Season1/ -r -i |
adjust-fps |
SubRefine | Stretch framerate (25.0 <-> 23.976) or shift offset | rightsub adjust-fps in.srt -o out.srt |
rightsub adjust-fps in.srt -o out.srt |
extract |
SubRefine | Extract subtitle tracks from MKV/MP4 using FFmpeg | rightsub extract video.mp4 -o out.srt |
rightsub extract video.mp4 -o out.srt |
transcribe |
quicksubs | On-device Speech-to-Subtitle transcription (Apple / Whisper) | rightsub transcribe video.mp4 |
rightsub transcribe video.mp4 |
audio-sync |
quicksubs | Subtitle retiming guided by authoritative audio | rightsub audio-sync bad.srt -v vid.mp4 -o ok.srt |
rightsub audio-sync bad.srt -v vid.mp4 -o ok.srt |
sync |
SubRefine | Compare timing delta between English & Hebrew SRTs | rightsub sync master.en.srt dl.he.srt |
rightsub sync master.en.srt dl.he.srt |
bible |
SubSwarm | Generate Character & Terminology Bible from SRTs & TMDb | rightsub bible Season1/*.srt -o b.json --tmdb |
rightsub bible Season1/*.srt -o b.json --tmdb |
split |
SubSwarm | Split master English SRT into ~210 cue JSON chunks | rightsub split ep.en.srt -o ./batches/ |
rightsub split ep.en.srt -o ./batches/ |
prompt-gen |
SubSwarm | Generate AI translation prompt waves with Bible & Context | rightsub prompt-gen ep.en.srt -t "Title" |
rightsub prompt-gen ep.en.srt -t "Title" |
config |
Core | Interactive API key onboarding and credentials manager (TMDb / Gemini) | rightsub config |
rightsub config |
doctor |
Core | System diagnostics & health check for dependencies and services | rightsub doctor |
rightsub doctor |
merge |
Both | Assemble translated JSONs into Hebrew SRT with RLM | rightsub merge ep.en.srt ./b/ -o ep.he.srt |
rightsub merge ep.en.srt ./b/ -o ep.he.srt |
qa |
Both | Zero-discrepancy 1:1 validation & gender mismatch audit | rightsub qa ep.en.srt ep.he.srt |
rightsub qa ep.en.srt ep.he.srt |
Note
Legal Disclaimer & Theoretical Benchmark Notice: References to the television series Boston Legal are presented strictly as a theoretical, hypothetical benchmark and synthetic case study for algorithmic stress-testing, timing synchronization research, and software demonstration purposes. All title names, character names, trademarks, and copyrights belong entirely to their respective copyright holders (20th Century Fox / Disney, David E. Kelley Productions). No copyrighted video files, audio tracks, or proprietary media assets are included, hosted, or distributed within this repository or software.
RightSub was validated across an end-to-end dataset modeled on the 5-season run of the courtroom drama Boston Legal:
- 101 / 101 Episodes Translated & Mastered (100% Completion).
- 78,000+ Dialogue Cues synchronized with 0 dropped lines.
- 100% Plex & Infuse BiDi Compliance across all devices (Apple TV, LG WebOS, Android TV).
- Universal Multi-Lingual Homoglyph Sanitization: Automatic neutralization and conversion of 7 foreign writing systems (Georgian, Armenian, Greek, Tibetan, Bengali, Thai, Katakana) into pure Hebrew.
- Full details in the Boston Legal Case Study.
RightSub comes with a comprehensive automated test suite (103 unit tests):
pytest -vTests cover:
- BiDi trailing punctuation and RLM idempotency.
- Hebrew acronym gershayim conversion (
Χ’ΧΧ΄Χ,ΧΧ¨ΧΧ΄Χ). - Multi-lingual homoglyph normalization (Georgian, Armenian, Greek, Arabic, Cyrillic, Asian).
- Translation Bible prompt injection & context overlap continuity.
- Direct-address vocative gender mismatch detection.
- CP1255 Windows-1255 charset detection and conversion.
- SDH auditory noise and commercial promo cleaning.
- Framerate arithmetic and time shifting.
- On-device STT CLI wrappers, fallback handlers, and audio-guided retiming algorithms.
- TMDb API metadata resolution, smart media filename parsing, and deterministic gender mapping.
- Documentation consistency, cross-platform parity, and valid link resolution.
- Live verification of all 101 episodes in the media dataset.
- π° Quickstart for Beginners (Step-by-Step) β Instant 30-second fix with zero jargon.
- π¦ Global Installation & Packaging Guide β Setting up Homebrew tap, Windows installer, and PATH configuration.
- ποΈ On-Device STT & Audio Alignment (
quicksubs) β Speech-to-subtitle extraction and audio-grounded alignment. - π¬ TMDb Metadata & Entity Resolution β Deterministic gender mapping, episodic guest stars, and dialect priming.
- π€ AI Integration & Coding Assistants Guide β What needs AI vs. what runs locally, plus Antigravity, Claude Code, Gemini, and ChatGPT setups.
- π Hebrew BiDi & Plex/Infuse Guide β Deep dive into invisible RLM marks and punctuation reversal.
- π End-to-End Pipeline Workflow β Step-by-step from raw video to deployed subtitles.
- βοΈ RightSub vs. Bazarr Technical Comparison β Architectural breakdown, differences, and integration guide.
- π Home Media & Download Integrations (qBittorrent, Sonarr, Radarr, Bazarr, Daemons) β Automated hands-off pipeline setups, why event hooks beat background daemons, and folder watcher scripts.
- πΊοΈ Official Product Roadmap β Shipped milestones, upcoming releases (v1.4, v1.5), and GitHub tracking.
- π§ͺ RFC 001: Interactive TUI Specification β Terminal user interface and diff approval spec.
- π RFC 002: Native MCP Server Specification β Model Context Protocol architecture for AI agents.
- βοΈ RFC 003: System Integration Wizard Specification β Automated downloader hooks & service setup.
- π Semantic AI Polish & Subtitle QC Guide β Autonomous proofreading, canon harmonization, and diff auditing.
- π What's New & Release Notes β Curated product milestone announcements and feature highlights.
- π Official GitHub Wiki β Complete bilingual online documentation.
- quicksubs by Matt Birchler β High-performance on-device macOS speech-to-text CLI engine powering local transcription and audio-guided subtitle retiming.
- Quick Subtitles β The companion Mac application for desktop subtitle and transcript workflows.
- The Movie Database (TMDb) β Community-built movie and TV database providing the rich metadata, cast, episodic guest star, and gender APIs (This product uses the TMDb API but is not endorsed or certified by TMDb).
This project is licensed under the MIT License β see the LICENSE file for details.
