YouTube transcripts to RAG-ready volumes
Project description
ytrag
YouTube transcripts → RAG-ready volumes.
Download YouTube subtitles and consolidate them into LLM-ready volumes.
Quick Start
# Install from PyPI
pipx install ytrag
# Download and process a YouTube channel
ytrag all "https://youtube.com/@ChannelName"
That's it! The transcripts will be cleaned and organized into volumes ready for use with LLMs.
Installation
With pipx (recommended)
pipx install ytrag
With pip
pip install ytrag
From Source
git clone https://github.com/chakkyy/ytrag.git
cd ytrag
pip install .
Usage
# Process a YouTube channel
ytrag all "https://youtube.com/@ChannelName"
# Process a single video
ytrag all "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# Process a playlist
ytrag all "https://www.youtube.com/playlist?list=PLxxxxxxx"
Options
# Specify languages (default: auto-detect from video)
ytrag all "https://..." --lang es,en,pt
# Custom output directory
ytrag all "https://..." --output ./my-transcripts
# Adjust transcripts per volume (default: 100)
ytrag all "https://..." --per-volume 50
# Check status of current directory
ytrag status
# Show version
ytrag --version
Output Structure
After running ytrag all, your directory will look like:
./
└── ChannelName/
├── ChannelName_Vol01.txt # LLM-ready volume
├── ChannelName_Vol02.txt
├── manifest.json # Metadata
└── .ytrag_archive # Resume tracking
Each volume contains cleaned, consolidated transcripts ready for use with LLMs and RAG systems.
Features
- Simple: One command does everything
- Auto language detection: Defaults to video's original language
- Resume support: Re-run to continue where you left off
- Clear progress: Shows current/total videos and ETA while downloading large channels
- Accurate channel counts: Channel root URLs automatically target the Videos tab
- Smart deduplication: Skips regional variants (en-US if en exists)
- Adaptive rate limiting: Automatically handles YouTube rate limits
- Clean output: No intermediate files, just the volumes you need
Requirements
- Python 3.10+
Troubleshooting
"No subtitles found"
Some videos don't have subtitles enabled. Try:
- Using
--langwith different language codes - Auto-generated subtitles are downloaded by default
Rate limiting errors
YouTube may rate-limit downloads. ytrag handles this automatically with exponential backoff, but for large channels you may need to wait or run again later.
License
MIT
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
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 ytrag-2.1.0.tar.gz.
File metadata
- Download URL: ytrag-2.1.0.tar.gz
- Upload date:
- Size: 21.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1375c6f5beba9eec89739031b8e46c4394c794987c17f5a780dc42717cb90353
|
|
| MD5 |
c7134fe44906c7d03b4259fdf88ced44
|
|
| BLAKE2b-256 |
43b36bd2669769291982fd445c0f8ca126574f9f9e56dfc1419c671e3876d769
|
File details
Details for the file ytrag-2.1.0-py3-none-any.whl.
File metadata
- Download URL: ytrag-2.1.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36b95f7f7c2a7d798fd8c8f9545638d43ed04398b16c412546ac47951e0ad238
|
|
| MD5 |
3520eaae7f0192037fba566260e1f46d
|
|
| BLAKE2b-256 |
f2b6fc237072bb7dc86b63053315bf6740ce1ce7e10199606a117e37e7748a40
|