A multi-thread Python script to translate SubRip (.srt) subtitles using AI (g4f) in seconds.
The script takes an input .srt file, translates the subtitle text from a specified input language to a specified output language using an AI model (at the moment deepseek-v3 by Blackbox) from gpt4free, and saves the translated subtitles to a new .srt file. No api/token needed.
- Generate a virtual environment
python -m venv .venv
source .venv/bin/activate
- Install dependences
pip install g4f\[all\] argparse pycountry tqdm colorama
Help:
python srt-ai-translator.py -h
Translation (Available languages: ISO 639-2 Codes):
python srt-ai-translator.py input.srt eng ita