CLI tool written in Rust for subtitle management: list, extract, and inject subtitles from MKV files, as well as search and download subtitles from SubSource.net.
- Search subtitles from SubSource.net by movie/show title
- Download subtitles (auto-extract ZIP to SRT)
- List all subtitle tracks in a video file
- Extract subtitle from MKV to separate SRT file
- Inject subtitle into MKV file
- Default language prioritization in search results
- Configurable default language and output directory
- API key management
- Rust toolchain (to build from source)
- mkvtoolnix (
mkvmerge,mkvextract) - required for MKV operations (list/extract/inject)
# Arch Linux
sudo pacman -S mkvtoolnix
# Debian/Ubuntu
sudo apt install mkvtoolnixThe search and download features do not require any external dependencies beyond the compiled binary itself.
# Build and install to ~/.local/bin
./build.sh install
# Or deploy directly
./deploy.sh user # Install to ~/.local/bin
./deploy.sh system # Install to /usr/local/bin (requires sudo)# Development build
./build.sh dev
# Release build (optimized)
./build.sh release
# Clean build artifacts
./build.sh cleanFirst, configure your API key from SubSource.net:
sub key setupOr set via environment variable:
export SUBSOURCE_API_KEY=your_api_key# Show current config
sub config show
# Set default language
sub config set lang indonesian
# Set default output directory
sub config set dir ~/Downloads
# Reset to defaults
sub config resetSupported languages: indonesian, english, french, spanish, japanese, korean, chinese, malay, thai, vietnamese, arabic, portuguese, german, italian, russian
# Search subtitles (interactive)
sub search "Hoppers 2026"
# Search with year filter
sub search "Hoppers" -y 2026
# Search for English subtitles
sub search "Hoppers" -y 2026 -l english
# Non-interactive (auto-select first)
sub search "Hoppers" -y 2026 -l indonesian -n
# Verbose mode (print raw API response)
sub search "Hoppers" -v
# Download to specific directory
sub search "Hoppers" -o /tmpIn interactive mode, you can:
- Type a number to select a specific subtitle (e.g.
1,3,5) - Type a range (e.g.
1-3) - Type
allto download all subtitles - Press Enter to select the default (first result)
sub download <movie_id> <subtitle_id> -o /tmpList subtitle tracks:
sub list movie.mkvOutput marks the default language tracks with a star symbol.
Extract subtitle:
sub extract movie.mkv -i 2
sub extract movie.mkv -i 2 -o subs.srtInject subtitle:
sub inject movie.mkv subtitle.srt
sub inject movie.mkv subtitle.srt -l ind -n Indonesian
sub inject movie.mkv subtitle.srt -l eng -n "English [SDH]"sub key setup # Configure API key (interactive)
sub key add <key> # Add/update API key directly
sub key show # Show API key (masked)
sub key remove # Remove stored API key| Command | Description |
|---|---|
sub list <video> |
List all subtitle tracks in video |
sub extract <video> -i <id> |
Extract subtitle track to SRT file |
sub inject <video> <subtitle> |
Inject subtitle into MKV file |
sub search <query> |
Search and download subtitles from SubSource |
sub download <movie_id> <sub_id> |
Download subtitle by ID |
sub key setup |
Setup API key |
sub config show |
Show current configuration |
sub config set lang <code> |
Set default language |
sub config set dir <path> |
Set default output directory |
sub config reset |
Reset all configuration |
| Flag | Description |
|---|---|
-i <id> |
Track ID (required) |
-o <file> |
Output filename |
| Flag | Description |
|---|---|
-l <lang> |
Language code (default: ind) |
-n <name> |
Track name |
| Flag | Description |
|---|---|
-l <lang> |
Language (override default) |
-y <year> |
Release year filter |
-o <dir> |
Output directory (override default) |
-n |
Non-interactive (auto-select first) |
-v |
Verbose |
sub/
├── Cargo.toml # Dependencies and build config
├── build.sh # Build script
├── deploy.sh # Deploy script
├── src/
│ ├── main.rs # CLI entry point
│ ├── config.rs # Config and API key management
│ ├── mkv.rs # MKV operations
│ └── subsource.rs # SubSource API client
└── target/ # Build artifacts
All dependencies are managed by Cargo (Cargo.toml):
clap- CLI argument parsingreqwest- HTTP clienttokio- Async runtimeserde/serde_json- JSON parsingcolored- Terminal colorszip- ZIP extractiontempfile- Temporary filesdirs/home- Home directory resolution
mkvtoolnix- Required forlist,extract, andinjectcommands. Not required forsearchanddownload.
MIT