Skip to main content

Dub any YouTube video into Hindi (and 19 other languages) with a casual, engaging neural voice.

Project description

🎙️ youtube-dubber

PyPI version Python License: GPL v3 GitHub

Dub any YouTube video into Hindi (and 19 other languages) with a casual, engaging neural voice — like a desi YouTuber, not a robotic narrator.

Give it a URL → it pulls the captions, translates them to natural casual speech, generates a neural voice, and saves synced dubbed audio clips + a manifest. Fully headless — use it in scripts, servers, or pipelines.

How it works


⚡ Quick start

pip install youtube-dubber
export GROQ_API_KEY=gsk_xxxxxxxx        # free key → https://console.groq.com/keys
from youtube_dubber import dub

manifest = dub(
    "https://www.youtube.com/watch?v=VIDEO_ID",
    lang="hindi",       # any of 20 languages
    gender="female",    # "male" or "female"
    out="./out",
)
print(len(manifest["segments"]), "segments dubbed")

Or from the command line:

youtube-dubber --url https://youtu.be/VIDEO_ID --lang hindi --gender female --out ./out

Output: out/audio/<videoId>_<lang>_<gender>/seg_NNNNN.mp3 clips + out/manifest.json.


⚠️ System Requirements

pip install brings the Python code, but you must also have these on your system (they are not pip-installable Python packages):

Requirement Why Install
🐍 Python 3.10+ runtime
🎬 ffmpeg audio conversion / time-stretch sudo apt install ffmpeg · brew install ffmpeg · windows
⬇️ yt-dlp fetches captions & stream info pip install -U yt-dlp
🔑 Groq API key translation + Whisper STT (free tier) console.groq.com/keys
🌐 Internet edge-tts calls Microsoft's neural voices

💡 Install yt-dlp alongside the package: pip install "youtube-dubber[ytdlp]" ffmpeg must be on your PATH — it is a system binary, not a pip package.


🌍 Supported languages (20)

Indian (casual Hinglish / code-switch style — tech terms stay English): Hindi · Tamil · Telugu · Bengali · Marathi · Gujarati · Kannada · Malayalam · Punjabi · Urdu

International (full translation): Spanish · French · German · Japanese · Chinese · Korean · Arabic · Portuguese · Russian · Italian

Each has a male & female neural voice. Source language is auto-detected — dub an Arabic, Chinese, or English video into Hindi, all the same way.


🧠 Live progress (callback API)

from youtube_dubber import Dubber

def on_event(ev):
    if ev["type"] == "progress":
        print(f"[{ev['step']}] {ev['pct']}%  {ev['msg']}")
    elif ev["type"] == "segment":
        print("dubbed:", ev["dubbed"])

Dubber(lang="hindi", gender="male", out_dir="./out", on_event=on_event).run(url)

Event types: stream_url · progress · segment · done · error


✨ Why it's different

  • Casual, not robotic — prompt-tuned to sound like a real creator ("तो भाई, scene ये है…"), not a textbook
  • Auto language detection — works on any source language out of the box
  • Disk cache — re-running the same video is instant (no re-translation/TTS)
  • Rate-limit resilient — automatic retries so segments never silently vanish
  • Fit-to-window timing — clips are speed-matched (≤1.4×) so dubbing stays in sync without sounding sped-up

🖥️ Want the desktop app instead?

This package is the headless engine. There's also a full Electron desktop app (paste a URL, watch the dubbed video live with subtitles) and a real-time Live Dub mode — see the GitHub repo:

👉 github.com/Ashut90/youtube-dubber


📄 License

GPL-3.0 — © 2026 Ashutosh (@Ashut90). Forks must stay open source and credit the original. See LICENSE.

Built with Groq · edge-tts · yt-dlp · ffmpeg.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

youtube_dubber-0.1.2.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

youtube_dubber-0.1.2-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file youtube_dubber-0.1.2.tar.gz.

File metadata

  • Download URL: youtube_dubber-0.1.2.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for youtube_dubber-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5cc273561ba1188c84c6633b6ac75d1ce254e2ecfe0f1762c182fea778af7f91
MD5 f23165eee09f6922405f3448b8a02265
BLAKE2b-256 64482f7a1a375b8e19f82f41458bc422eecba929698ca9f970b9f31bf178a66d

See more details on using hashes here.

File details

Details for the file youtube_dubber-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: youtube_dubber-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for youtube_dubber-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da2d3d2ab1027a61cfc97275e3923705b7c47917f141b710a868c6bdc672ac45
MD5 bb12425ee1f59f8490d298d833acad5b
BLAKE2b-256 fc3b279c14f2eff1b4abd3ccffa02b0c52310643d719fa40c2c9db2d648f4458

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page