AGENT SKILL

souldub-video-translate

Translate, dub, or localize local MP4 videos with SoulDub AI video translation and original-voice dubbing. Use when the user asks to translate a video into another language or Chinese dialect, AI dub an MP4, localize video content, generate translated or bilingual SRT subtitles, create a SoulDub video translation task, track long-running translation progress, or download translated video results.

License 许可
MIT
所属仓库
bg-szy/TOP-SKILLS
最近更新
2026-11-15
Stars
★ 6
Forks
0

01 前言 Front Matter

name
souldub-video-translate
license
MIT
description
Translate, dub, or localize local MP4 videos with SoulDub AI video translation and original-voice dubbing. Use when the user asks to translate a video into another language or Chinese dialect, AI dub an MP4, localize video content, generate translated or bilingual SRT subtitles, create a SoulDub video translation task, track long-running translation progress, or download translated video results.

02 资源文件 2

03 SKILL.md 正文

SoulDub Original-Voice Video Translation

Use this skill to translate local MP4 videos with SoulDub. Let the scripts handle upload, task creation, polling, result download, saved state, and retry behavior. The agent should understand the user's intent, collect missing parameters, call the scripts, report progress, and explain the final result.

Runtime requirements: Python 3.11+, uv, network access to the SoulDub API, read access to the source video, and write access to the output directory. The scripts declare dependencies with PEP 723 and must be run with uv run; do not call python scripts/video_translation.py directly.

Parameter Collection

Always confirm these parameters from the user request:

  • Source video absolute path: must be a local .mp4 file.
  • Target language: accept natural language names such as English, Spanish, Chinese, Cantonese, 日语, 中文, or 粤语. Do not require the user to provide language codes such as en or zh.

Optional parameters:

  • Source language: default auto; the user may also provide natural language names such as English, Japanese, Chinese, 日语, or 中文.
  • Speaker count: default 0; allowed range is 0..15, where 0 means auto-detect.

The target language must not be auto. references/languages.json is the SoulDub supported-language registry. It contains only code, Chinese name, and English name fields; it does not maintain arbitrary aliases. The agent may understand language names in any user language, but before calling translate it should normalize the language to a SoulDub language code or a registered English/Chinese name, then validate it with resolve-language.

Language validation examples:

uv run scripts/video_translation.py resolve-language --mode target --text ja
uv run scripts/video_translation.py resolve-language --mode target --text Japanese
uv run scripts/video_translation.py resolve-language --mode target --text 日语
uv run scripts/video_translation.py resolve-language --mode source --text auto

If the user says a language name in another language, such as 일본어, japonés, japonais, or 日文, first understand it as ja, then validate with --text ja. After validation succeeds, prefer the returned code for --source-language or --target-language.

If language validation fails, ask the user to choose a supported language or describe the language another way. Do not force the user to provide a language code.

Configuration

Before first use, check authentication:

uv run scripts/video_translation.py auth status

If no API key is configured, the script creates this user-level config file:

~/.souldub/souldub.config.yaml

The user must create an API key at https://www.souldub.ai/en/settings/apikeys, set souldub_api_key in the config file, and save it. CI or temporary runs may use the SOULDUB_API_KEY environment variable.

Authentication precedence:

  1. SOULDUB_API_KEY environment variable
  2. User config at ~/.souldub/souldub.config.yaml

User config example:

api_base: "https://xxx.com/api/v1"
souldub_api_key: "your-agent-api-key"

Translation Workflow

Agents should start long-running jobs in background mode by default, so the session remains responsive and can report progress. Run commands from the skill directory:

uv run scripts/background_translate.py start --video <absolute-mp4-path> --target-language <language-name>

Common optional parameters:

uv run scripts/background_translate.py start --video <absolute-mp4-path> --source-language auto --target-language English --speaker-count 0

When the start command succeeds, it returns JSON immediately. If the JSON includes state_path, remember pid, state_path, output_dir, stdout_path, and stderr_path, then tell the user that the job has started in the background. If the JSON status is started_without_state_yet, remember pid, stdout_path, and stderr_path, then wait briefly and read stderr_path until the first progress event provides state_path. The background process continues by calling the main script to:

  • Read config and obtain the API key by authentication precedence.
  • Validate the MP4 file and calculate videoDurationSeconds.
  • Calculate SHA-256 and send it as checksumSha256 when creating the task.
  • Upload the video, create the translation task, and use a stable Idempotency-Key for safe retry.
  • Poll with 2s -> 5s -> 10s -> 20s -> 30s backoff.
  • Download result.mp4, translated.srt, and bilingual.srt.
  • Append a numeric suffix if a destination file already exists, avoiding silent overwrite.

If the current agent environment is not suitable for background processes, or if manual debugging is needed, run the main script in the foreground:

uv run scripts/video_translation.py translate --video <absolute-mp4-path> --source-language auto --target-language English --speaker-count 0

Default output directory:

<source-video-directory>/souldub_outputs/<timestamp>-<filename-stem>/

Default state directory:

platformdirs.user_state_dir(".souldub")/runs/<run-id>/

The state directory stores only state.json and progress.log. It must not store API keys, upload presigned URLs, media download URLs, or temporary signature parameters.

Progress Reporting

Script stdout prints only the final JSON result. Script stderr prints JSONL progress events. The agent should not repeat every JSONL event to the user.

Reporting rules:

  • Report once immediately after the background start succeeds, and remember run_id, state_path, output_dir, and pid.
  • Report concise updates when the stage changes.
  • During uploading, run status --state <state-json-path> about every 10 seconds, but report only when the stage or progress changes.
  • During task_processing, run status --state <state-json-path> about every 60 seconds, but report only when the stage, status, or progress changes.
  • Report immediately when the job completes or fails.
  • For rate limits or concurrency limits, explain that the script is waiting for service-side limits to clear. Do not describe it as stuck.

Stages:

validating
reading_config
uploading
upload_completed
task_created
task_processing
downloading
completed
failed

User Status Follow-Up

If the user asks for status, whether the translation is done, or where the job is:

  1. If the current session has state_path, run:
uv run scripts/video_translation.py status --state <state-json-path>
  1. If state_path is unknown, run:
uv run scripts/video_translation.py list-runs

Then choose the most likely run by source video path, target language, update time, or run_id, and run status --state <state-json-path>. If multiple candidates remain and there is no reliable choice, ask the user to confirm.

  1. If status cannot read the state file but the current session has stderr_path, read the most recent JSONL progress events and summarize the stage, progress, and output directory.

If the task completed but local download failed, continue downloading with the same state_path. Do not upload again or create another task:

uv run scripts/video_translation.py download --state <state-json-path>

The continuation command refreshes temporary media URLs and saves subtitle files first. If the media gateway is temporarily unreachable, explain the video download failure and still report any subtitle paths that were saved successfully.

Results and Failures

On success, tell the user the local file paths, especially:

  • Translated video: result.mp4
  • Target-language subtitles: translated.srt
  • Bilingual subtitles: bilingual.srt
  • Output directory: output_dir

Additionally, notify the user that they can visit https://www.souldub.ai/en/dashboard/projects and open the video dubbing editor to further edit subtitle segments, audio segments.

Common failure handling:

  • UNAUTHORIZED, API_KEY_INVALID, API_KEY_EXPIRED, API_KEY_REVOKED: ask the user to check the API key.
  • INSUFFICIENT_CREDITS: explain that credits are insufficient; do not retry automatically.
  • INVALID_LANGUAGE: ask the user to choose a supported language.
  • INVALID_SPEAKER_COUNT: explain that speaker count must be 0..15.
  • RATE_LIMITED: the script waits according to Retry-After.
  • CONCURRENCY_LIMIT_REACHED: the script backs off and waits; do not retry aggressively.

Read references/agent-api.md for detailed API behavior when needed. Read references/languages.json for the supported-language registry.

04 同仓库更多 Skills

bg-szy
bg-szy/TOP-SKILLS

serpmaven

Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.

★ 6
bg-szy
bg-szy/TOP-SKILLS

revnu-landing-page-audit

Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: "audit my landing page", "why isn't this page converting", "review my homepage", "my ads get clicks but no signups", "people bounce from the pricing page", "CRO review", "improve conversion rate", "is my hero section clear", "roast my landing page", "rewrite my headline", "what's wrong with this page", "landing page feedback", "make the signup page convert better". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.

★ 6
bg-szy
bg-szy/TOP-SKILLS

revnu-growth-context

Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents/revnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says "set up our marketing context", "who is our ideal customer", "write our ICP", "describe the product for marketing", "positioning doc", "what's our brand voice", "remember this about our customers", "log what we tried", "what have we learned from marketing", "we changed pricing, update the context", "update our growth notes", "summarize the business for the agent", "import my product-marketing.md", "start a growth doc", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.

★ 6
bg-szy
bg-szy/TOP-SKILLS

revnu-get-listed

Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: "best X" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says "get us listed", "which directories should we submit to", "how do we get into best-of lists", "why does ChatGPT recommend competitors and not us", "get mentioned in AI answers", "submit to awesome lists", "get on G2", "where are our competitors listed", "pitch listicle authors", "find backlink opportunities", "launch directories", "get into roundups", "Product Hunt alternatives", "where should we be listed", "get cited by Perplexity". Never submits, pays or posts without a yes. Works without a Revnu account.

★ 6
bg-szy
bg-szy/TOP-SKILLS

revnu-ai-readiness-audit

Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks "is my site ready for AI search", "audit my site for AI answers", "AEO audit", "GEO audit", "why doesn't ChatGPT quote our pricing", "make our pages citable by AI", "do I need llms.txt", "does schema help with ChatGPT", "check our structured data", "is our content visible without JavaScript", "AI SEO audit", "optimize our homepage for AI answers", "LLM SEO check", "why does AI get our product wrong", "fix our site for AI Overviews". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.

★ 6
bg-szy
bg-szy/TOP-SKILLS

proxy-troubleshooting

Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.

★ 6