A tool to download YouTube videos and audio with embedded thumbnails.
Project description
sgithidownloader
A Python tool to download YouTube videos and audio in various high-quality formats with embedded thumbnails and metadata.
Features
- Download individual YouTube videos or entire playlists
- Support for multiple video formats (MP4, WebM, etc.)
- Convert and download audio in various formats (Opus, MP3, FLAC, AAC, etc.)
- Automatically embed video thumbnails as album art
- Include metadata (title, artist, album, date, description) in supported formats
- Crop thumbnails to square format for better display
Installation
Prerequisites
- Python 3.8 or higher
- FFmpeg (for audio processing)
Install FFmpeg
On Ubuntu/Debian:
sudo apt update
sudo apt install ffmpeg
On macOS:
brew install ffmpeg
On Windows: Download from ffmpeg.org and add to PATH.
Install the Package
git clone <your-repo-url>
cd OpusDownloader
pip install .
For development:
pip install -e .
Usage
Download a Single Video
sgithidownloader -s "https://www.youtube.com/watch?v=VIDEO_ID" -o /path/to/output/
Download a Playlist
sgithidownloader -p "https://www.youtube.com/playlist?list=PLAYLIST_ID" -o /path/to/output/
Download Audio
sgithidownloader -s "https://www.youtube.com/watch?v=VIDEO_ID" -f audio -af opus -o /path/to/output/
Options
-s, --single URL: Download a single video-p, --playlist URL: Download all videos in a playlist-o, --output DIR: Output directory (default: current directory)-f, --format FORMAT: File format for video (mp4, webm, audio, etc.) (default: mp4)-af, --audio_format FORMAT: Audio format (best, aac, alac, flac, m4a, mp3, opus, vorbis, wav) (default: best)-l, --listFormats: List available audio formats and exit--help: Show help message
Examples
# Download a single video to the current directory
sgithidownloader -s "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# Download a playlist to a specific folder
sgithidownloader -p "https://www.youtube.com/playlist?list=PLrAXtmRdnEQy4qtr5G1G8jQGzq9j9j9j" -o ~/Videos/
# Download audio in MP3 format
sgithidownloader -s "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -f audio -af mp3 -o ~/Music/
# List available audio formats
sgithidownloader -l
Dependencies
- yt-dlp: For downloading and extracting audio
- mutagen: For embedding metadata in audio files
- pytube: For playlist handling
- pillow: For image processing
- requests: For downloading thumbnails
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Disclaimer
This tool is for personal use only. Respect YouTube's terms of service and copyright laws. The author is not responsible for misuse.
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 sgithidownloader-1.0.0.tar.gz.
File metadata
- Download URL: sgithidownloader-1.0.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cdb10fd01bbedf3ac7b5f04bc1b0e417dc0b65cd978d84468d501a11d6b3716
|
|
| MD5 |
1da0d835c8e735a2ce9179e332b4fed9
|
|
| BLAKE2b-256 |
692ed18efa7ff152172e554192805d08d2e35ead456c77c03435a135a5e89c45
|
File details
Details for the file sgithidownloader-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sgithidownloader-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0fe77523a41216f5b15cefd67a0046a4ad3af7c7bc9754f07fc1fa9837cc620
|
|
| MD5 |
0020e78cd5725dbc7b887d8b8bcdd915
|
|
| BLAKE2b-256 |
644ba61a7415181efa3b65f5bc86e254ea018489337b6cf2feceac32c5b41ec1
|