首页龙虾技能列表 › Subtitle Translator — 技能工具

Subtitle Translator — 技能工具

v0.1.1

[自动翻译] Translate SRT subtitle files using LLM APIs with OpenAI-compatible format. Supports both single-language and bilingual output. Use when you need to tr...

0· 561·7 当前·7 累计
by @thetail001 (Thetail001)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/4/11
安全扫描
VirusTotal
可疑
查看报告
OpenClaw
安全
high confidence
The skill's code and instructions align with its stated purpose (translating SRT files via an OpenAI-compatible API); it requires an API key and network access which is expected, and there is no evidence of hidden endpoints or unrelated privileges.
评估建议
This skill appears to do exactly what it says: translate .srt files by sending subtitle text to an OpenAI-compatible API. Before using it, consider: (1) you must supply an API URL and API key — the registry metadata omitted declaring this credential; treat the key like any secret. (2) Prefer environment variables or a secret manager over the suggested plaintext config file (~/.openclaw/skills/.../config.json). (3) The skill sends all subtitle text to whatever API URL you provide — do not use it ...
详细分析 ▾
用途与能力
Name/description match the included scripts: parse/validate SRT files and call an OpenAI-compatible chat/completions endpoint to produce translations. No unrelated binaries, services, or capabilities are requested.
指令范围
SKILL.md instructions correspond to what the scripts do: read an input .srt, validate, batch text to an LLM API, and write an output .srt. The scripts only reference SRT input/output, API URL/key/model, and standard proxy env vars; they do not attempt to read other system credentials or unrelated files.
安装机制
No install spec; this is instruction + script files only. Nothing is downloaded or executed from external URLs during install, so install risk is low.
凭证需求
The skill legitimately needs an API endpoint and API key to function (scripts require --api-key / env SUBTITLE_API_KEY). However, the registry metadata declared no required environment variables or primary credential — this is a documentation/metadata omission. The SKILL.md also recommends optionally storing the key in ~/.openclaw/skills/subtitle-translator/config.json (plaintext), which increases risk if the user follows it. The scripts respect http_proxy/https_proxy, meaning a misconfigured or malicious proxy could capture the API key (and SKILL.md appropriately warns about this).
持久化与权限
always is false and the skill does not request system-wide persistence or modify other skills. It suggests writing an optional per-skill config file under the user's home directory (expected and scoped to the skill).
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv0.1.12026/2/25

- Default batch size for translation reduced from 250 to 50 sentences (configurable). - Added script: scripts/validate_srt.py for validating SRT file format. - Updated documentation with security considerations and best practices for storing API keys. - Expanded configuration options: now supports environment variables and command line arguments (recommended over config files). - Improved documentation for quick start, validation usage, and workflow steps.

● 可疑

安装命令 点击复制

官方npx clawhub@latest install subtitle-translate-skill
镜像加速npx clawhub@latest install subtitle-translate-skill --registry https://cn.clawhub-mirror.com

技能文档

Overview

Translate 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.

Features

  • Format Support: SRT subtitles
  • API Compatibility: OpenAI-compatible endpoints
  • Output Modes: Single-language or bilingual (translation above original)
  • Batch Processing: 50 sentences per batch (configurable) with 1-second intervals
  • Progress Tracking: Detailed logging of task progress and execution
  • Validation: Ensures sentence count consistency and timestamp preservation

Quick Start

Basic Translation

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

Bilingual Output

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-...

Validate SRT File

python3 scripts/validate_srt.py input.srt

List Available Models

python3 scripts/list_models.py \
  --api-url https://api.openai.com/v1 \
  --api-key sk-...

Configuration

Option 1: Environment Variables (Recommended)

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

Option 2: Command Line Arguments

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

Option 3: Config File (Less Secure)

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.

Security Considerations

  • API Key Storage: Use environment variables or secure secret managers instead of plaintext config files
  • API Endpoint: Ensure you trust the API URL you provide
  • Proxy Environment: The scripts honor http_proxy/https_proxy environment variables. If your environment uses untrusted proxies, API keys could be captured
  • Network Traffic: All subtitle content is sent to the API endpoint. Do not use with sensitive/confidential content unless you control the API

Workflow

  • Parse SRT: Extract index, timecodes, and text
  • Validate: Optional validation of input format
  • Batch Translation: Send 50 sentences per request (configurable)
  • Validate: Ensure output count matches input
  • Reconstruct: Combine original timecodes with translations
  • Output: Generate SRT file

Resources

scripts/

  • translate_srt.py - Main translation script
  • list_models.py - List available models from API
  • validate_srt.py - Validate SRT file format

references/

  • srt_format.md - SRT file format specification
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务