A program that uses deepl or google to translate multiple subtitle files. Both services offer free api access.
pip install -r requirements.txt
- Run the program once to create the credential files.
- At least one api key must be provided for the program to run.
- Setup free access to the Deepl Translate api. Link
- Get the api key from here and paste it in the
deepl api key.txt
file.
- Setup free access to the Google Translate api. Link
- Get the api key from here and paste it in the
google api key.txt
file.
- A folder containing the subtitles to be translated and the source and target language should be provided.
- The subtitles should all have
.srt
extensions.
translation_dir = Path(r"C:\Users\user1\Downloads\Chinese Videos")
source_lang, target_lang = "ch", "en"