Skip to content

elektro-wolle/vtt-translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM based subtitle translation

Simple python wrapper around Mistral to translate .vtt-subtitles into another language.

Running

Python3 is required, install a venv and the required dependencies:

python3 -m venv .venv
. .venv/bin/activate
pip3 install -r requirements.txt

Run the translation on a given VTT file:

python3 translate.py --lang de --key APIKEY subtitle-file.vtt

The translated subtitles are stored in the same directory of the import file (with a two-letter language added).

Usage

usage: translate.py [-h] [--lang LANG] [--key KEY] [input_file]

VTT translator

positional arguments:
  input_file   Filename of the english VTT file to translate, default `text.vtt`.

options:
  -h, --help   show this help message and exit
  --lang LANG  Two letter iso-code for the target language, default `de`.
  --key KEY    Mistral API key, if not given as environment variable `MISTRAL_API_KEY`.

License

MIT - 2025 Wolfgang Jung

About

Simple translation utility for subtitle translations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages