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, AVI, MKV)
  • 🎧 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
  • 📊 Beautiful progress bars and colored output
  • 🚀 Intuitive subcommand-based CLI interface
  • 🌐 User-friendly web interface with real-time progress tracking

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

pip install sgithidownloader

For development:

git clone https://github.com/AceCJM/SgithiDownloader.git
cd SgithiDownloader
pip install -e .

Usage

The CLI uses a modern subcommand structure for clarity:

Download a Single Video

sgithidownloader video "https://www.youtube.com/watch?v=VIDEO_ID" -o /path/to/output/

Download Audio

sgithidownloader audio "https://www.youtube.com/watch?v=VIDEO_ID" -f opus -o /path/to/output/

Download a Playlist

sgithidownloader playlist "https://www.youtube.com/playlist?list=PLAYLIST_ID" -t audio -f mp3 -o /path/to/output/

List Available Formats

sgithidownloader formats

Get Help

# General help
sgithidownloader --help

# Help for specific command
sgithidownloader video --help
sgithidownloader audio --help
sgithidownloader playlist --help

Web Interface

For users who prefer a graphical interface, SgithiDownloader includes a beautiful web UI:

sgithidownloader webui

This will start a local web server at http://localhost:5000 where you can:

  • 📱 Use an intuitive form-based interface
  • 📊 Monitor download progress in real-time
  • 📁 Browse and download completed files
  • 🎯 Select formats with visual options
  • 📂 Choose custom output directories

Web UI Features

  • Real-time Progress: Watch downloads progress with live updates
  • Format Selection: Easy dropdown menus for video/audio formats
  • Download History: View and download previously completed files
  • Responsive Design: Works on desktop and mobile devices
  • Background Processing: Downloads run in the background without blocking the UI

Command Reference

sgithidownloader video

Download a single YouTube video.

sgithidownloader video URL [OPTIONS]

Options:

  • -o, --output DIR: Output directory (default: current directory)
  • -f, --format FORMAT: Video format (mp4, webm, avi, mkv) (default: mp4)

sgithidownloader audio

Download audio from a YouTube video.

sgithidownloader audio URL [OPTIONS]

Options:

  • -o, --output DIR: Output directory (default: current directory)
  • -f, --format FORMAT: Audio format (best, aac, alac, flac, m4a, mp3, opus, vorbis, wav) (default: best)

sgithidownloader playlist

Download all videos from a YouTube playlist.

sgithidownloader playlist URL [OPTIONS]

Options:

  • -o, --output DIR: Output directory (default: current directory)
  • -t, --type TYPE: Download type (video or audio) (default: video)
  • -f, --format FORMAT: Format (depends on type - video: mp4/webm/avi/mkv, audio: opus/mp3/etc.) (default: mp4)

sgithidownloader formats

Display all available video and audio formats with descriptions.

sgithidownloader webui

Start the web interface for graphical downloads.

sgithidownloader webui

Description: Launches a local web server at http://localhost:5000 with a user-friendly interface for downloading YouTube content.

Examples

# Download a single video in MP4 format
sgithidownloader video "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -f mp4

# Download audio in high-quality Opus format
sgithidownloader audio "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -f opus -o ~/Music/

# Download an entire playlist as MP3 files
sgithidownloader playlist "https://www.youtube.com/playlist?list=PLrAXtmRdnEQy4qtr5G1G8jQGzq9j9j9j" -t audio -f mp3 -o ~/Music/Playlist/

# Download a playlist of videos
sgithidownloader playlist "https://www.youtube.com/playlist?list=PLrAXtmRdnEQy4qtr5G1G8jQGzq9j9j9j" -o ~/Videos/

# List all available formats
sgithidownloader formats

Supported Formats

Audio Formats

  • best: Auto-select best quality (recommended)
  • opus: High quality, supports metadata
  • mp3: Universal compatibility, supports metadata
  • flac: Lossless, high quality
  • aac: Good quality, wide support
  • m4a: AAC in MP4 container
  • alac: Apple Lossless
  • vorbis: Open source, good quality
  • wav: Uncompressed

Video Formats

  • mp4: Most compatible format
  • webm: Open format, good compression
  • avi: Legacy format
  • mkv: Advanced container format

Note: Metadata embedding is only supported for opus and mp3 formats.

Dependencies

  • yt-dlp: For downloading and extracting media
  • mutagen: For embedding metadata in audio files
  • pytube: For playlist handling
  • rich: For beautiful console output
  • tqdm: For progress bars
  • pillow: For image processing
  • requests: For downloading thumbnails
  • flask: For the web interface

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-2.0.3.tar.gz (15.0 MB view details)

Uploaded Source

Built Distribution

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

sgithidownloader-2.0.3-py3-none-any.whl (18.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sgithidownloader-2.0.3.tar.gz
  • Upload date:
  • Size: 15.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for sgithidownloader-2.0.3.tar.gz
Algorithm Hash digest
SHA256 b1363e61c6dad14f46c4ecf388a5d114fdbe703a1c41dc087bf8c5804d50d0e9
MD5 722f94d17cbf648fd519e81e5fec11c7
BLAKE2b-256 b4eb5ef7d9ea76479c8216d6aa2bf65e7787b5cf47eb28d6f0379a6c890c2336

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sgithidownloader-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f71a8ce907f9bf97fa75e96853d1b42238e0b094e3da55e069d8c010cd03a535
MD5 0ae107396c352e036ee19cf13fbac7c9
BLAKE2b-256 4cbc99e93f8b154aea3e465f6e7cc0ebbdb8622560ac111e40b31e04482bc6e0

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