douyin-dubber

Auto-dub Douyin/TikTok videos into any language using a fully local pipeline: download with Playwright Chromium + Douyin cookie → transcribe with Whisper → translate subtitles with the AI agent → generate TTS (gTTS / Edge TTS / ElevenLabs) → timing stretch with FFmpeg atempo → mix original audio at 10% + new TTS voice → burn ASS subtitle overlay (positioned over original sub area). Use when: (1) dubbing/translating a Douyin or TikTok video, (2) replacing original voice with translated TTS, (3) any "tải video douyin rồi dịch/lồng tiếng" request.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "douyin-dubber" with this command: npx skills add mcbaivn/mcbai-douyin-dubber

🚀 Developed by MCB AI · YouTube · OpenClaw 101

MCBAI Douyin Dubber

Full pipeline: Playwright download → Whisper transcribe → AI translate → TTS → FFmpeg ASS subtitle mix.


⚠️ Bảo Mật & Cookie

Skill này chạy hoàn toàn local — không upload video hay dữ liệu lên server nào ngoài các TTS provider bạn chọn.

Credentials cần thiết

CredentialBắt buộcMô tả
douyin_cookies.txt✅ CóCookie Douyin để tải video
ElevenLabs API key❌ KhôngChỉ cần nếu chọn ElevenLabs TTS

Cookie Douyin — Lưu ý quan trọng

⚠️ Cookie session = quyền truy cập tài khoản Douyin. Không chia sẻ file này với ai.

Khuyến nghị:

  • 🔐 Dùng tài khoản throwaway/test — không dùng tài khoản chính
  • 📁 Lưu cookie vào skills/douyin-dubber/douyin_cookies.txt (local only, không commit lên git)
  • ♻️ Rotate cookie sau khi dùng xong
  • 🚫 Không paste cookie vào bất kỳ tool/website nào khác

Override đường dẫn cookie bằng env var:

# macOS / Linux
export DOUYIN_COOKIE_FILE=/path/to/your/cookies.txt

# Windows
$env:DOUYIN_COOKIE_FILE = "C:\your\path\cookies.txt"

⚙️ Cài Đặt (chỉ làm 1 lần)

1 — Python 3.11+

python --version   # Python 3.11.x hoặc cao hơn

💡 Tải tại https://www.python.org/downloads/ — tick "Add Python to PATH" khi cài

2 — Playwright Chromium

pip install playwright
python -m playwright install chromium

3 — Whisper

pip install openai-whisper

⚠️ Cần FFmpeg trên PATH — tải tại https://ffmpeg.org/download.html

4 — TTS Providers (cài theo nhu cầu)

Option 1: gTTS — Mặc định ✅

pip install gtts
  • Miễn phí, không cần API key

Option 2: Edge TTS — Tự nhiên hơn, miễn phí

pip install edge-tts
  • Giọng Microsoft Neural, tự nhiên hơn gTTS
  • Giọng Việt: vi-VN-HoaiMyNeural (Nữ) / vi-VN-NamMinhNeural (Nam)

Option 3: ElevenLabs — Chất lượng cao nhất

  • Không cần cài thêm package
  • Cần API key từ https://elevenlabs.io (free: 10,000 ký tự/tháng)

5 — Cookie Douyin

Export cookies từ Chrome/Edge khi đang đăng nhập Douyin:

Cách 1 — Extension EditThisCookie:

  1. Cài EditThisCookie trên Chrome
  2. Vào www.douyin.com → đăng nhập
  3. Click icon extension → Export → chọn format "Header String"
  4. Lưu vào file douyin_cookies.txt trong thư mục skill

Cách 2 — DevTools (không cần extension):

  1. Vào www.douyin.com → đăng nhập → F12
  2. Tab ApplicationCookieswww.douyin.com
  3. Copy: sessionid, sid_tt, ttwid, uid_tt, odin_tt
  4. Ghép thành 1 dòng: sessionid=xxx; sid_tt=yyy; ttwid=zzz; ...
  5. Lưu vào douyin_cookies.txt

⚠️ Cookie hết hạn sau ~60 ngày → export lại khi bị lỗi download


🚀 Chạy Pipeline

Windows (PowerShell):

$env:PYTHONIOENCODING = "utf-8"
python skills/douyin-dubber/scripts/dubber.py `
  "https://www.douyin.com/video/XXXXX" `
  --lang Vietnamese `
  --outdir "./dubbed_output"

macOS / Linux:

PYTHONIOENCODING=utf-8 python skills/douyin-dubber/scripts/dubber.py \
  "https://www.douyin.com/video/XXXXX" \
  --lang Vietnamese \
  --outdir "./dubbed_output"

Script sẽ hỏi chọn TTS provider:

═══════════════════════════════════════════════════════
  🔊 CHỌN GIỌNG ĐỌC (TTS PROVIDER)
═══════════════════════════════════════════════════════

  1️⃣   gTTS  (Google TTS)          ← Mặc định
  2️⃣   ElevenLabs                  ← Chất lượng cao nhất
  3️⃣   Edge TTS (Microsoft Neural) ← Tự nhiên, miễn phí

  👉 Nhập 1, 2 hoặc 3 (mặc định = 1):

🔊 Chi Tiết TTS Providers

Option 1: gTTS

Chi phíMiễn phí
Chất lượng⭐⭐
API keyKhông cần
echo 1 | python dubber.py "URL" --lang Vietnamese --outdir "./output"

Option 2: Edge TTS (Microsoft Neural)

Chi phíMiễn phí
Chất lượng⭐⭐⭐⭐
API keyKhông cần
# Giọng nữ HoaiMy
echo "3\n1" | python dubber.py "URL" --lang Vietnamese --outdir "./output"

# Giọng nam NamMinh
echo "3\n2" | python dubber.py "URL" --lang Vietnamese --outdir "./output"

Danh sách giọng Việt:

Voice IDGiới tínhPhong cách
vi-VN-HoaiMyNeuralNữGiọng Bắc, tự nhiên
vi-VN-NamMinhNeuralNamGiọng Bắc, trầm

Option 3: ElevenLabs

Chi phí10k chars free/tháng
Chất lượng⭐⭐⭐⭐⭐
API keyBắt buộc

Giọng có sẵn:

#TênGiới tính
1RachelNữ
2BellaNữ
3AntoniNam
4JoshNam
5ArnoldNam
6ElliNữ
7CustomNhập Voice ID

Lấy API key:

  1. Đăng ký tại https://elevenlabs.io
  2. Vào Profile → API Keys → Create API Key
  3. Tick permission "Text to Speech"

⚡ Arguments

ArgDefaultDescription
urlrequiredDouyin/TikTok URL
--langVietnameseTarget language
--whisper-modelmediumtiny/base/small/medium/large
--outdir.Output directory
--original-vol0.10Volume audio gốc (0–1)
--skip-downloadDùng video có sẵn
--skip-transcribeDùng SRT có sẵn
--translated-srtDùng SRT đã dịch

⏭️ Skip Flags (Resume khi bị ngắt)

# Bỏ qua download
python dubber.py URL --skip-download ./work/original.mp4

# Bỏ qua transcribe
python dubber.py URL --skip-download video.mp4 --skip-transcribe original.srt

# Chỉ chạy TTS + mix
python dubber.py URL --skip-download video.mp4 --translated-srt translated.srt

📁 Output Structure

dubbed_output/
├── dubbed_original.mp4          ← Video output cuối cùng
└── dubber_work/
    ├── original.mp4             ← Video gốc
    ├── original.srt             ← Transcript (Whisper)
    ├── translated.srt           ← SRT đã dịch
    ├── subtitle.ass             ← ASS subtitle file
    ├── tts_track.mp3            ← TTS track hoàn chỉnh
    └── silence.mp3              ← Base silence track

🐛 Troubleshooting

LỗiNguyên nhânFix
UnicodeEncodeErrorTerminal không encode UTF-8Set PYTHONIOENCODING=utf-8
No video URL foundCookie hết hạnExport lại cookie từ browser
401 Unauthorized ElevenLabsAPI key sai hoặc thiếu permissionTạo key mới với permission TTS
402 Payment Required ElevenLabsHết creditsNạp thêm hoặc dùng account khác
Edge TTS retry nhiều lầnRate limitBình thường, script tự retry
ASS subtitle không hiển thịFont path saiCần Arial font tại /System/Library/Fonts hoặc C:/Windows/Fonts

📊 So Sánh TTS Providers

gTTSEdge TTSElevenLabs
Chi phíMiễn phíMiễn phí10k chars free/tháng
Chất lượng⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Tốc độNhanhChậm (rate limit)Nhanh
API keyKhôngKhông
Tiếng ViệtTốtRất tốtXuất sắc
Khuyến nghịTest nhanhDùng thường xuyênVideo quan trọng

<p align="center">Made with ❤️ by <a href="https://www.mcbai.vn">MCB AI</a> &nbsp;·&nbsp; <a href="https://www.youtube.com/@mcbaivn">YouTube</a> &nbsp;·&nbsp; <a href="https://openclaw.mcbai.vn/openclaw101">OpenClaw 101</a></p>

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Omnicast

A local multi-modal podcast pipeline. Ingests media, drafts scripts, synthesizes audio, renders cover art, and uploads to YouTube.

Registry SourceRecently Updated
2401Profile unavailable
General

Douyin Video Publisher

自动登录抖音账号,上传并发布视频到抖音创作者平台,支持视频标签管理和登录状态检查。

Registry SourceRecently Updated
6K22Profile unavailable
General

短视频脚本生成器

短视频口播脚本生成器。输入产品/话题,自动生成5分钟以内抖音/视频号口播脚本,包含开场钩子、叙事结构、话术技巧、BGM推荐和互动引导。适用场景:AI科普/印刷知识/产品介绍/行业干货。触发词:生成脚本/口播脚本/短视频文案/抖音脚本

Registry Source
1680Profile unavailable
General

Deapi Audio

Text-to-speech, voice cloning, voice design, and transcribe audio files via deAPI GPU network. Trigger on 'text to speech', 'TTS', 'generate voice', 'read al...

Registry Source
1671Profile unavailable