A versatile tool for YouTube media downloading and AI processing with SQLite-based glossary.
Project description
imansur-ytb
A professional, modular AI pipeline for high-quality YouTube media ingestion and technical translation.
Philosophy: Modular Pipeline Architecture
This library is designed as a series of independent pipeline components. Each module is decoupled, meaning you can use the downloader without the translator, or provide your own transcripts to the translation engine.
Installation
pip install imansur-ytb
Module 1: Media (The Collector)
Handles media downloading with zero-touch FFmpeg management.
from imansur_ytb import get_video
# Returns a list of metadata dictionaries containing file paths
media_list = get_video("https://youtube.com/watch?v=...", audio_only=True)
Module 2: Translator (The Intelligence)
A standalone technical translation engine optimized for English-to-Turkish dubbing scripts. It features AI Term Discovery and persistent SQLite memory.
from imansur_ytb import translate_transcript
# Use as a standalone tool for any transcript JSON
translated_data = translate_transcript(
transcript_path="my_transcript.json",
api_key="YOUR_GEMINI_KEY", # or set GEMINI_API_KEY in .env
verbose=True
)
Key Features of Module 2:
- Zero-Config .env Support: Automatically picks up
GEMINI_API_KEY. - SQLite Glossary: Ships with a default 1300+ term technical dictionary.
- Auto-Learning: Discovers new terms during translation and updates the local glossary.
- Consistency: Uses a double-pass AI logic to ensure terminology remains consistent across the entire transcript.
Parameter Reference
translate_transcript(...)
| Parameter | Type | Default | Description |
|---|---|---|---|
transcript_path |
str |
Required | Path to the input JSON transcript |
api_key |
str |
None |
Gemini API Key (Will check .env if None) |
model |
str |
"gemini-2.0-flash" |
AI Model (Optimized for Flash) |
Module 3: Synthesis (The Voice)
Converts text or transcripts to high-quality neural speech using edge-tts.
from imansur_ytb import synthesize_text, synthesize_transcript
# 1. Simple TTS (for PBX/Switchboard)
synthesize_text("Hoş geldiniz!", "welcome.mp3", voice="tr-TR-AhmetNeural")
# 2. Pipeline Dubbing (Timed & Synced)
synthesize_transcript("tr_transcript.json", output_file="full_dub.mp3", verbose=True)
Key Features of Module 3:
- Free & Unlimited: No API tokens required (uses Microsoft Edge TTS).
- Auto-Sync: Automatically calculates if a segment needs to be sped up to fit the video timing.
- Timed Merging: Uses FFmpeg to place audio segments at exact timestamps with correct silences.
Developed by imansur - Building the future of AI Dubbing.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imansur_ytb-0.7.5.tar.gz.
File metadata
- Download URL: imansur_ytb-0.7.5.tar.gz
- Upload date:
- Size: 51.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0821dcfb54c3381d87011950f66550c8e2b2800a920b5877fd955031742a0eb1
|
|
| MD5 |
28aa146258ee33851c4c6e586ab1db9a
|
|
| BLAKE2b-256 |
0dde324838a9f84bcdbff7ab5b730d78e539cd015a0b11a2a53f719eed94a6bd
|
File details
Details for the file imansur_ytb-0.7.5-py3-none-any.whl.
File metadata
- Download URL: imansur_ytb-0.7.5-py3-none-any.whl
- Upload date:
- Size: 50.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5ffa13337ee524e217aebe3a45c9674aee70cc4871b50c1612e05fa3252207d
|
|
| MD5 |
9531cec014c5cb93db93a5c512c1d549
|
|
| BLAKE2b-256 |
ef1acea95522f716cb8d7d2540f14c0525d9ac58093a12e9b0b5b570531eba87
|