A fast YouTube video downloader with parallel processing
Project description
UDown
A fast YouTube video downloader with parallel processing capabilities. Downloads audio and video streams simultaneously for optimal performance.
Features
- ⚡ Parallel Processing: Downloads audio and video streams simultaneously
- 📊 Performance Profiling: Detailed timing reports for download operations
- 🎯 High Quality: Downloads best available audio and video streams
- 📝 Caption Support: Optional subtitle/caption downloads
- 🔧 FFmpeg Integration: Automatic audio-video merging
- 🖥️ Cross-Platform: Works on Windows, macOS, and Linux
Installation
From PyPI (Recommended)
pip install udown
From Source
git clone https://github.com/dipanjal/udown.git
cd udown
pip install -e .
Prerequisites
- Python 3.8+
- FFmpeg: Required for audio-video merging
Installing FFmpeg
macOS
brew install ffmpeg
Ubuntu/Debian
sudo apt update
sudo apt install ffmpeg
Windows
Download from FFmpeg official website or install via Chocolatey:
choco install ffmpeg
Usage
Basic Usage
udown -o ~/Downloads [youtube_url]
Advanced Usage
# Download to custom directory
udown -o ~/Downloads [youtube_url]
# Download with captions
udown -c -o ~/Downloads [youtube_url]
# Enable debug mode with detailed timing
udown -d -o ~/Downloads [youtube_url]
# Combine options
udown -o ~/Videos -c -d [youtube_url]
Command Line Options
| Option | Description |
|---|---|
-o, --output |
Output directory (default: ./downloads) |
-c, --caption |
Download captions/subtitles if available |
-d, --debug |
Enable debug mode with detailed timing |
--version |
Show version information |
-h, --help |
Show help message |
Examples
# Download a video
udown -o ~/Downloads https://www.youtube.com/watch?v=dQw4w9WgXcQ
# Download with captions to Downloads folder
udown -c -o ~/Downloads https://www.youtube.com/watch?v=dQw4w9WgXcQ
# Debug mode to see performance metrics
udown -d -o ~/Downloads https://www.youtube.com/watch?v=dQw4w9WgXcQ
Performance
The parallel processing approach provides significant time savings:
- Sequential Download: Audio + Video + Merge = Total Time
- Parallel Download: Max(Audio, Video) + Merge = Reduced Time
Sample Output
Downloading: Example Video Title
Downloading Audio File
Downloading Video File
Video downloaded successfully to: ./downloads/Example Video Title.mp4
==================================================
DOWNLOAD PERFORMANCE REPORT
==================================================
Audio Took: 12.34 seconds
Video Took: 15.67 seconds
Merging Took: 2.45 seconds
Expected Duration: 30.46 seconds
Total Process Time: 18.23 seconds
==================================================
Time Saved: 12.23 seconds
==================================================
Development
Setup Development Environment
git clone https://github.com/dipanjal/udown.git
cd udown
make install
Running Tests
pytest
Code Formatting
black ytdl/
Architecture
udown/
├── ytdl/
│ ├── __init__.py # Package initialization
│ ├── cli.py # Command-line interface
│ ├── downloader.py # Core download logic
│ ├── profiler.py # Performance timing
│ └── utils.py # Utility functions
├── setup.py # Package setup
├── pyproject.toml # Modern packaging config
└── README.md # This file
How It Works
- URL Validation: Validates YouTube URL format
- Stream Analysis: Identifies best audio and video streams
- Parallel Downloads: Downloads audio and video simultaneously
- FFmpeg Merge: Combines streams into final video file
- Performance Profiling: Tracks timing for optimization
Contributing
- 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
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Support
- 📧 Email: dipanjalmaitra@gmail.com
- 🐛 Issues: GitHub Issues
- 📖 Documentation: GitHub Wiki
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 udown-0.0.2.tar.gz.
File metadata
- Download URL: udown-0.0.2.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a62fb2dfe97835db93b4ee408a9c3b465623933aaf5d5f873a8d0e5d26d9e378
|
|
| MD5 |
900cd1fbd59b8095fe8caeab51363b5e
|
|
| BLAKE2b-256 |
94307a803acfb79c6babce0a4292bcd0fe872d7cbe618b9b6992793204174a08
|
File details
Details for the file udown-0.0.2-py3-none-any.whl.
File metadata
- Download URL: udown-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8350f613d22cde7fc910c3d65d403a4c2b893c7f1efd97bd07b34ea958ef5ed4
|
|
| MD5 |
9c5490f85b8c1bbe42cc6e326eb22662
|
|
| BLAKE2b-256 |
f54209d6da43df2733c13c0c9a181c423a9602934a72be4f93cd371f4911169a
|