Skip to main content

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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. 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

sgithidownloader-1.0.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sgithidownloader-1.0.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file sgithidownloader-1.0.1.tar.gz.

File metadata

  • Download URL: sgithidownloader-1.0.1.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

Hashes for sgithidownloader-1.0.1.tar.gz
Algorithm Hash digest
SHA256 fa61d66c0c48958610f914e6ada1575cee224819f3de9d2a0f3266cc71d5ce7a
MD5 812a4417576f54511b42cdd7c458827e
BLAKE2b-256 1d202d2d466c2ede48270dc145b0035d048593f325a1b2356ee2f519e523d04c

See more details on using hashes here.

File details

Details for the file sgithidownloader-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sgithidownloader-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 163db1870c1af3d4fb10a727aff3b1ff27638be25d67f56e816d6cc58e0b7983
MD5 ab3581a6c807f664db0610f9ec1e5f12
BLAKE2b-256 09d11d36b41844359c8932417cd8cdc018d56de474e7ca757c803b0079d63618

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page