← 返回
未分类 Key 中文

MCBAI Douyin Dubber

Auto-dub Douyin/TikTok videos into any language using a fully local pipeline: download with Playwright Chromium + Douyin cookie → transcribe with Whisper → t...
Auto-dub Douyin/TikTok videos into any language using a fully local pipeline: download with Playwright Chromium + Douyin cookie → transcribe with Whisper → t...
mcbaivn mcbaivn 来源
未分类 clawhub v1.0.4 1 版本 100000 Key: 需要
★ 0
Stars
📥 322
下载
💾 0
安装
1
版本
#douyin#dubbing#ffmpeg#latest#mcbai#tiktok#tts#vietnamese#whisper

概述

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

Made with ❤️ by MCB AI  ·  YouTube  ·  OpenClaw 101

版本历史

共 1 个版本

  • v1.0.4 当前
    2026-05-07 16:04 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Blotato Post Everywhere

mcbaivn
通过 Blotato API 在多个社交平台发布和排程内容,自动适配各平台格式并支持媒体上传。
★ 0 📥 442

Facebook Page Manager

mcbaivn
通过Graph API自动管理并发布内容到Facebook主页。全面支持:文本/图片帖子、轮播图(多图)、视频、Reels短视频、Story(图片/视频)、定时发布...
★ 0 📥 434

Subtitle Translator - MCB AI

mcbaivn
使用AI将SRT字幕文件翻译成任意目标语言,批量处理以高效处理大文件,并保持原始SRT格式。
★ 0 📥 433