WebVTT Translator is a Python package for translating WebVTT subtitle files into different languages using various translation APIs.
- Translate WebVTT subtitle files to multiple languages.
- Support for various translation APIs (e.g., Google Translate, Microsoft Translator).
- Easy-to-use command-line interface.
Before using WebVTT Translator, you need to have an OpenAI API Key. Set the API key as an environment variable:
export OPENAI_API_KEY='your_openai_api_key'
set OPENAI_API_KEY=your_openai_api_key
$env:OPENAI_API_KEY='your_openai_api_key'
You can install the package using pip:
pip install webvtt-translator
To translate a WebVTT file, use the following command:
webvtt-translator translate -i input.vtt -o output.vtt -l Portuguese
You can also run the module via python:
python -m webvtt_translator -i input.vtt -o output.vtt -l Portuguese
The command line arguments are:
-i
or--input
: Path to the input WebVTT file.-o
or--output
: Path to the output translated WebVTT file.-l
or--language
: Target language (e.g., Spanish, English, Portuguese).
For any questions or suggestions, please open an issue on GitHub.