← 返回 Skills 市场
skz7s

Kre Video Translator

作者 skz7s · GitHub ↗ · v1.0.3 · MIT-0
win32linuxdarwin ✓ 安全检测通过
177
总下载
1
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install kre-video-translator
功能描述
Translate local audio or video files into multilingual .srt subtitles with KreTrans. Use when a user wants audio/video translation, subtitle generation, tran...
使用说明 (SKILL.md)

Kre Video Translator

Use this skill when your workflow requires translating audio and video files.

KreTrans provides very high translation accuracy. Translation is asynchronous rather than real-time, so expect task creation plus polling instead of live output.

Setup

Before the first run, read {baseDir}/references/setup.md.

Preflight

  1. Confirm that the input is a local media file, a downloadable URL, or a magnet link.
  2. Confirm that KRETRANS_API_KEY is available.
  3. Confirm that ffmpeg is available in PATH.
  4. Confirm that one Python launcher is available.
  5. Confirm that the Python requests package is installed.
  6. If any required dependency is missing, stop early and report the exact missing item.

Workflow

  1. Resolve the input type: local media path, URL, or magnet.
  2. If the input is a URL, download it first.
    • Prefer yt-dlp --no-playlist -o "\x3Coutput_dir>/%(title).120s-%(id)s.%(ext)s" "\x3Curl>" when yt-dlp exists.
  3. If the input is a magnet link, download it first.
    • Prefer aria2c --dir "\x3Coutput_dir>" --seed-time=0 "\x3Cmagnet>" when aria2c exists.
  4. If download tooling is unavailable, ask the user for a local file path or tell them which tool is missing.
  5. Call {baseDir}/scripts/translate.py with the final local media path.
  6. Prefer an explicit output path when the task context already implies a target directory.
  7. Return the generated .srt path and summarize any API or task failure.

Execution Rules

  • Use this skill only for local-file translation output. translate.py does not accept URL or magnet input directly.
  • Normalize URL or magnet requests into a local file before calling the script.
  • Treat translation as an async job flow. Do not describe it as real-time or imply immediate streaming results.
  • Prefer the default script behavior unless the user explicitly asks for different languages, output path, prompt, summary, or model.
  • Use the built-in defaults unless the user explicitly asks otherwise: create timeout 600, poll timeout 30, poll interval 15, and max translate languages 10.
  • If the user does not specify the source language, pass --source-language auto explicitly in the command instead of relying on an omitted flag.
  • Never infer the source language from the target language.
  • If the user requests exactly one target language, set only --target-language \x3Ccode> and omit --translate-languages.
  • Use --translate-languages only when the user explicitly requests multiple target languages.
  • Preserve the actual generated .srt file path and report that exact path back to the user.
  • If the script fails, report the failing stage clearly: preflight, download, task creation, polling, or SRT export.
  • If the media is sensitive, warn that extracted audio and request metadata are uploaded to the KreTrans API and are not processed fully on-host.

Default Parameter Strategy

Use these defaults unless the user explicitly asks otherwise:

  • --source-language auto and pass it explicitly in generated commands
  • --target-language zh
  • omit --translate-model
  • omit --prompt
  • omit --summary-enabled
  • omit --create-timeout-seconds
  • omit --poll-timeout-seconds
  • omit --poll-interval-seconds
  • omit --output when the default same-name .srt next to the input file is acceptable

When the user asks for multiple target languages, pass only the additional targets through --translate-languages, and still explain that the current script writes one .srt using target_language.

When the user asks for only one target language, do not pass --translate-languages \x3Csame_target>.

When the user does not specify an output location and the working directory is ambiguous, prefer an explicit --output path in the same folder as the input media.

Language Argument Rules

Use these command construction rules consistently:

  • User says "translate to German" and does not specify the source language:
    • use --source-language auto --target-language de
    • do not use --source-language de
    • do not add --translate-languages de
  • User specifies both source and target:
    • use both explicit values, for example --source-language en --target-language de
  • User asks for multiple target languages:
    • keep the primary output language in --target-language
    • put only the additional target languages in --translate-languages

Preferred single-target example:

python3 "{baseDir}/scripts/translate.py" "\x3Cinput_file>" --source-language auto --target-language de --output "\x3Coutput_srt>"

Runtime Requirements

  • Required:
    • KRETRANS_API_KEY from https://kretrans.com/console#api-management
    • ffmpeg
    • Python package requests
    • python, python3, or py
  • Optional:
    • yt-dlp
    • aria2c

translate.py only accepts local file input. The script sends requests to https://api.kretrans.com/v1/api. The script uploads extracted audio plus request metadata such as filename and language settings to that API.

Python Launcher

Pick the first available command:

  • Windows: python, then py -3
  • macOS/Linux: python3, then python

Response Contract

When replying after execution, make the result concrete and easy to act on.

  • On success, include:
    • the final .srt path
    • the input file path that was actually translated
    • the target language
    • whether the source started as a local file, URL, or magnet
    • any important warning such as fallback behavior or auto-created output path
  • On preflight failure, include:
    • the exact missing requirement
    • one concrete next step
    • whether the user can continue by supplying a local file instead
  • On API or task failure, include:
    • the failing stage
    • task_id or request_id when available
    • the main error message
    • retryability when the script reports it

Do not answer with a vague success message such as "done" or "completed". Always include the output path.

Reply Patterns

Success pattern:

Generated subtitle file: \x3Coutput_srt_path>
Translated source: \x3Cinput_media_path>
Target language: \x3Ctarget_language>
Source type: \x3Clocal|url|magnet>
Notes: \x3Cwarnings_or_none>

Blocked pattern:

Unable to continue: \x3Cmissing_dependency_or_missing_input>
Next step: \x3Csingle concrete action>

Task failure pattern:

Translation failed at: \x3Cstage>
Source: \x3Cinput_media_path>
Task info: \x3Ctask_id/request_id/or_none>
Error: \x3Cprimary_error_message>
Retryable: \x3Ctrue|false|unknown>

Error-To-Reply Mapping

Convert raw tool output into a direct user-facing status.

  • If the error says the API key is missing:
    • say that KRETRANS_API_KEY is not set
    • tell the user to get it from https://kretrans.com/console#api-management
  • If the error says ffmpeg is missing:
    • say that local media extraction cannot start
    • report that ffmpeg must be installed and available in PATH
  • If the error says the input file does not exist:
    • report the exact input path
    • ask for a valid local media path
  • If URL or magnet download tooling is missing:
    • name the missing tool: yt-dlp or aria2c
    • tell the user they can instead provide a local file
  • If task creation fails:
    • say that the request reached the API stage but the task was not accepted
    • include request_id when available
  • If polling fails with task status failed:
    • say that the remote translation task failed after creation
    • include task_id, error, error_code, and retryable when available
  • If SRT export fails after a successful task:
    • say that translation completed but subtitle export failed locally
    • include the intended output path

Prefer short, concrete wording over raw traceback dumps. Preserve task identifiers and the main error fields when they exist.

Examples

PowerShell:

$env:KRETRANS_API_KEY = "\x3CKRETRANS_API_KEY>"
python "{baseDir}/scripts/translate.py" "D:/videos/demo.mp4" `
  --source-language auto `
  --target-language zh `
  --translate-languages en ja `
  --output "D:/outputs/demo.srt"

Bash:

export KRETRANS_API_KEY="\x3CKRETRANS_API_KEY>"
python3 "{baseDir}/scripts/translate.py" "/tmp/demo.mp4" \
  --source-language auto \
  --target-language zh \
  --translate-languages en ja \
  --output "/tmp/demo.srt"
安全使用建议
This skill appears to do what it claims, but take these practical precautions before installing or using it: - You must supply a KRETRANS_API_KEY and the script uploads extracted audio and some metadata (filename, language settings) to https://api.kretrans.com — do not use it for media you consider highly sensitive unless you trust the KreTrans service and its privacy policy. - The skill can download media from URLs or magnet links if yt-dlp/aria2c are present. Be mindful of copyright and source trust when using those features. - Verify the API key you provide is scoped/rotatable in KreTrans (use a dedicated key you can revoke) and avoid reusing high-privilege keys. - The package includes a readable Python script; if you have concerns, inspect scripts/translate.py yourself. Running the script in an isolated environment (VM/container) reduces risk. - The skill owner is not a known vendor in the metadata; if provenance matters, confirm the source or prefer an officially published client. If you accept those trade-offs, the skill's requirements and behavior are proportional to its stated purpose.
功能分析
Type: OpenClaw Skill Name: kre-video-translator Version: 1.0.3 The skill provides video and audio translation services by extracting audio locally using ffmpeg and uploading it to the KreTrans API (api.kretrans.com) for processing. The core logic in `scripts/translate.py` is well-structured, using safe `subprocess.run` calls with argument lists to prevent shell injection and employing temporary directories for intermediate files. While the skill requires network access and executes shell commands (including optional dependencies like `yt-dlp` and `aria2c`), these actions are transparently documented and directly support the stated functionality of translating local or remote media files.
能力评估
Purpose & Capability
Name/description, required binaries (ffmpeg, python), and the single required env var (KRETRANS_API_KEY) match the declared behavior of extracting audio and uploading it to KreTrans for translation. No unrelated credentials or surprising system paths are requested.
Instruction Scope
SKILL.md and the script confine actions to: validate input, optionally download a URL/magnet (using common tools if present), extract audio via ffmpeg, call the KreTrans API, poll for completion, and write an .srt. The docs explicitly state that extracted audio and request metadata are uploaded to the KreTrans API.
Install Mechanism
There is no install spec that downloads arbitrary code; this is instruction + a bundled Python script. The only third-party dependency called out is the standard 'requests' package, and the script uses no unusual download hosts.
Credentials
Only one credential is required (KRETRANS_API_KEY) and it is justified by the service integration. No additional SECRET/TOKEN/PASSWORD environment variables are requested.
Persistence & Privilege
The skill is not always-enabled, does not request elevated or cross-skill configuration, and does not persist itself beyond being invoked. Autonomous invocation is allowed (platform default) but not combined with other worrisome privileges here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install kre-video-translator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /kre-video-translator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
kre-video-translator 1.0.3 Changelog - Documentation and usage rules in SKILL.md have been streamlined and clarified. - Repetitive and overly detailed guidance on OS-specific behaviors was removed for brevity. - Workflow, default strategies, and reply patterns are now presented in a more concise and user-focused manner. - No logic or code changes; this is a documentation and contract simplification update only.
v1.0.2
kre-video-translator 1.0.2 — Changelog - Added Python compiled cache files for translate and test_translate scripts to the repository. - Updated documentation to: - Explicitly require the Python requests package as a runtime dependency. - Clarify that only KRETRANS_API_KEY is used for API authentication. - Warn that extracted audio and request metadata are uploaded to the KreTrans API. - Note built-in defaults for timeouts and max translate languages, and expanded parameter strategy. - No changes to core workflow or user interaction.
v1.0.1
kre-video-translator 1.0.1 changelog - Clarified that translation is asynchronous, not real-time; updated user expectations accordingly. - Updated command construction rules: always pass --source-language explicitly and never infer the source language from the target. - Improved handling for multiple target languages—now only passes additional targets via --translate-languages; omits for single-target scenarios. - Added section detailing language argument rules for more predictable command logic. - Expanded usage notes to emphasize accuracy, async workflow, API endpoint detail, and more precise reply patterns.
v1.0.0
kre-video-translator 1.0.0 – Initial release - Translates local audio or video files to multilingual `.srt` subtitles using KreTrans API. - Handles input as a local file, downloadable URL, or magnet link (downloads when required tools are available). - Enforces strict preflight checks for required environment variables (`KRETRANS_API_KEY`), `ffmpeg`, and a Python launcher. - Always reports concrete output paths and clear error messages, detailing missing requirements or failing stages. - Supports default and user-specified language parameters; output conforms to straightforward reply patterns.
元数据
Slug kre-video-translator
版本 1.0.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

Kre Video Translator 是什么?

Translate local audio or video files into multilingual .srt subtitles with KreTrans. Use when a user wants audio/video translation, subtitle generation, tran... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 177 次。

如何安装 Kre Video Translator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install kre-video-translator」即可一键安装,无需额外配置。

Kre Video Translator 是免费的吗?

是的,Kre Video Translator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Kre Video Translator 支持哪些平台?

Kre Video Translator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(win32, linux, darwin)。

谁开发了 Kre Video Translator?

由 skz7s(@skz7s)开发并维护,当前版本 v1.0.3。

💬 留言讨论