Interactive YouTube Downloader CLI powered by yt-dlp
Project description
ytdl - Interactive YouTube Downloader
A feature-rich, interactive CLI for downloading YouTube videos and playlists with ease.
Built on top of yt-dlp with an intuitive menu system powered by questionary.
Features • Installation • Quick Start • Documentation • Contributing
✨ Features
- 🎯 Interactive Menu System - Easy-to-use interface with questionary
- 📋 Playlist Auto-Detection - Automatically detects and organizes playlists
- ⚡ Quick Default Download - One-click download with optimal settings
- 🎨 Advanced Configuration - Fine-tune every aspect of your downloads
- 📁 Smart Naming Templates - Multiple presets + custom template support
- 🎵 Audio Extraction - Download and convert to MP3
- 🖼️ Rich Post-Processing - Thumbnails, subtitles, metadata embedding
- 🚀 SponsorBlock Integration - Automatically remove sponsors and ads
- 🌍 Geo-Bypass & Proxy Support - Download region-restricted content
- 📊 Real-time Progress - Live download progress and speed display
📦 Installation
From PyPI (Recommended)
pip install ytdl-interactive
From Source
# Clone the repository
git clone https://github.com/abd3lraouf/ytdl.git
cd ytdl
# Install in development mode
pip install -e .
Requirements
- Python 3.9 or higher
- FFmpeg (for video/audio processing)
Installing FFmpeg
macOS (Homebrew):
brew install ffmpeg
Ubuntu/Debian:
sudo apt update
sudo apt install ffmpeg
Windows (Chocolatey):
choco install ffmpeg
Or download from ffmpeg.org
🚀 Quick Start
Basic Usage
# Download a single video
ytdl https://www.youtube.com/watch?v=dQw4w9WgXcQ
# Download a playlist
ytdl "https://www.youtube.com/playlist?list=PLxxxxxx"
# Download from a channel
ytdl https://www.youtube.com/@channelname
Command-line Options
ytdl [URL] # Start interactive mode with URL
ytdl --version # Show version information
ytdl --help # Display help message
📖 Usage Guide
Main Menu
After providing a URL, you'll see the main menu:
1. Quick Default Download (Recommended)
└─ Downloads with optimal settings:
- Best quality video + audio
- Saved to ./downloads/
- Auto-organized playlists
2. Advanced Download Settings
└─ Customize every aspect:
- Format selection
- Output paths and naming
- Post-processing options
- Network settings
3. Exit
Quick Default Download
The quickest way to download with optimal settings:
- Format: Best quality video + audio (automatically merged)
- Output:
./downloads/ - Single videos:
Title.ext - Playlists:
PlaylistName/001 - VideoTitle.ext
Example output structure:
downloads/
├── My Awesome Playlist/
│ ├── 001 - First Video.mp4
│ ├── 002 - Second Video.mp4
│ └── 003 - Third Video.mp4
└── Single Video Title.mp4
Advanced Settings
1. Download Type/Format
- Video (Best Quality) -
bestvideo*+bestaudio/best - Audio Only (MP3) - Extracts and converts to MP3 (192 kbps)
- List Formats - View all available formats and select custom format codes
2. Output Path & Naming
Preset Templates:
| Template | Format | Example |
|---|---|---|
| Default | %(title)s.%(ext)s |
My Video.mp4 |
| Rich Metadata | %(upload_date)s - %(channel)s - %(title)s.%(ext)s |
20231215 - Channel Name - My Video.mp4 |
| Minimalist | %(id)s.%(ext)s |
dQw4w9WgXcQ.mp4 |
| Custom | Your template | Define your own! |
Playlist Auto-Organization: All templates automatically organize playlists into subfolders with zero-padded indices.
Custom Template Variables:
%(title)s - Video title
%(id)s - Video ID
%(ext)s - File extension
%(upload_date)s - Upload date (YYYYMMDD)
%(channel)s - Channel name
%(uploader)s - Uploader name
%(playlist)s - Playlist name
%(playlist_index)s - Video index in playlist
%(duration)s - Video duration
%(view_count)s - View count
3. Post-Processing Options
- Embed Thumbnail - Embed video thumbnail in the file
- Embed Subtitles - Download and embed subtitles (English/Arabic)
- Add Metadata - Add rich metadata to the file
- SponsorBlock - Automatically remove sponsor segments and ads
4. Networking Options
- Proxy Support - Route downloads through a proxy
http://proxy.example.com:8080 socks5://proxy.example.com:1080 - Geo-Bypass - Bypass geographic restrictions
💡 Examples
Download a single video with defaults
ytdl https://www.youtube.com/watch?v=dQw4w9WgXcQ
# Select: 1. Quick Default Download
Download playlist as MP3s
ytdl "https://www.youtube.com/playlist?list=PLxxxxxx"
# Select: 2. Advanced Settings
# → Select Download Type → Audio Only (MP3)
# → Start Download
Custom output with metadata
ytdl https://www.youtube.com/watch?v=VIDEO_ID
# Select: 2. Advanced Settings
# → Output Path → Select "Rich Metadata"
# → Post-Processing → Check all options
# → Start Download
Download with proxy
ytdl https://www.youtube.com/watch?v=VIDEO_ID
# Select: 2. Advanced Settings
# → Networking → Enter proxy URL
# → Start Download
🏗️ Project Structure
ytdl/
├── ytdl.py # Main application
├── pyproject.toml # Package configuration
├── requirements.txt # Dependencies
├── README.md # This file
├── LICENSE # MIT License
└── .gitignore # Git ignore rules
🤖 Automated Releases
This project uses automated versioning and CI/CD:
- Automatic versioning via
setuptools_scm(based on git tags) - Automated PyPI publishing on new releases
- CI testing on all PRs and pushes
- Release drafts auto-generated from commits
Creating a New Release
- Go to Actions → Bump Version → Run workflow
- Select version type (patch/minor/major)
- Workflow automatically:
- Creates git tag
- Generates changelog
- Creates GitHub release
- Publishes to PyPI
See CONTRIBUTING.md for detailed release process.
🛠️ Development
Setup Development Environment
# Clone repository
git clone https://github.com/abd3lraouf/ytdl.git
cd ytdl
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode with dev dependencies
pip install -e ".[dev]"
Code Structure
# Main components:
DownloadConfig # Configuration container
progress_hook() # Real-time download progress
postprocessor_hook() # Post-processing status
detect_playlist() # Playlist detection
execute_download() # Download execution
show_main_menu() # Interactive menu system
Running Tests
# Install dev dependencies
pip install -e ".[dev]"
# Run tests (when available)
pytest
# Code formatting
black ytdl.py
# Type checking
mypy ytdl.py
🤝 Contributing
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Guidelines
- Follow PEP 8 style guidelines
- Add comments for complex logic
- Update README for new features
- Test thoroughly before submitting
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- yt-dlp - The powerful downloader this tool is built upon
- questionary - Beautiful interactive prompts
- All contributors and users of this project
⚠️ Disclaimer
This tool is for personal use only. Please respect copyright laws and YouTube's Terms of Service. Only download content you have permission to download.
🐛 Bug Reports & Feature Requests
Found a bug or have a feature request? Please open an issue on GitHub.
📮 Contact
- GitHub: @abd3lraouf
- Issues: GitHub Issues
🗺️ Roadmap
- Configuration file support (~/.ytdlrc)
- Download queue management
- Resume interrupted downloads
- Batch download from file
- GUI wrapper (tkinter/PyQt)
- Docker support
- Download scheduler
Made with ❤️ by developers, for developers
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 ytdl_interactive-1.1.1.tar.gz.
File metadata
- Download URL: ytdl_interactive-1.1.1.tar.gz
- Upload date:
- Size: 26.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9984d01f15a563d12bd553ce5f182bf46ec2f8cb252cc3e890dfd94a081b30aa
|
|
| MD5 |
cdea77700d52f15073a3532468165424
|
|
| BLAKE2b-256 |
b36f476e520c18833b7a2a44d0df1a3c224435d5dd59e824ef3d034cb99ce6c9
|
File details
Details for the file ytdl_interactive-1.1.1-py3-none-any.whl.
File metadata
- Download URL: ytdl_interactive-1.1.1-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
498c90ca297a8afac29cf6ad84244790d1ae72bc46960ca60f0cd66ea596eb6d
|
|
| MD5 |
93eaab6160c66d74c8273fedea67ab7a
|
|
| BLAKE2b-256 |
f234d03d81ccf131cad5cb77ac066ff5a205fb3d1f36e1ec7d2ee2ba836ddcd0
|