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.2.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.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sgithidownloader-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 28bdc4f7fcaa54998479cf1b979de6fc35f909be1daf903ded512124818d698c
MD5 29658b92bcdeb93222e533c22665dbc0
BLAKE2b-256 64f3c66b584deebad65c86a3fe9758db062e8dfe37396790e2c9813c5e7a0e84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sgithidownloader-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ac8b518451aa208f1fda41d7df8fd136c7a233dce83158356bd524616c6e27e0
MD5 3e559194b5087e7654169b2c3a5983eb
BLAKE2b-256 53299c940fbf200f3665ad785c1186dc3163f9b734bba909be905f09d11098ca

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