Install
openclaw skills install subtitle-translate-skillTranslate SRT subtitle files using LLM APIs with OpenAI-compatible format. Supports both single-language and bilingual output. Use when you need to translate subtitle files (.srt) from one language to another while preserving timestamps. Processes in batches of 50 sentences with progress logging.
openclaw skills install subtitle-translate-skillTranslate SRT subtitle files using LLM APIs. Supports OpenAI-compatible API format with customizable URL, API key, and model selection. Outputs single-language or bilingual subtitles with original timestamps preserved.
python3 scripts/translate_srt.py \
--input video.srt \
--output video_zh.srt \
--source-lang en \
--target-lang zh \
--api-url https://api.openai.com/v1 \
--api-key sk-... \
--model gpt-4
python3 scripts/translate_srt.py \
--input video.srt \
--output video_bilingual.srt \
--source-lang en \
--target-lang zh \
--bilingual \
--api-url https://api.openai.com/v1 \
--api-key sk-...
python3 scripts/validate_srt.py input.srt
python3 scripts/list_models.py \
--api-url https://api.openai.com/v1 \
--api-key sk-...
export SUBTITLE_API_URL="https://api.openai.com/v1"
export SUBTITLE_API_KEY="sk-your-api-key"
export SUBTITLE_MODEL="gpt-4"
python3 scripts/translate_srt.py -i input.srt -o output.srt
python3 scripts/translate_srt.py \
-i input.srt \
-o output.srt \
-u https://api.openai.com/v1 \
-k sk-your-api-key \
-m gpt-4
Create ~/.openclaw/skills/subtitle-translator/config.json:
{
"api_url": "https://api.openai.com/v1",
"api_key": "sk-your-api-key",
"model": "gpt-4",
"batch_size": 50,
"batch_interval_ms": 1000,
"output_mode": "single",
"log_level": "info"
}
⚠️ Security Warning: Storing API keys in plaintext config files increases risk. Prefer environment variables or command line arguments.
http_proxy/https_proxy environment variables. If your environment uses untrusted proxies, API keys could be capturedtranslate_srt.py - Main translation scriptlist_models.py - List available models from APIvalidate_srt.py - Validate SRT file formatsrt_format.md - SRT file format specification