Skip to content

Choose a tag to compare

@SwarnenduG07 SwarnenduG07 released this 24 Oct 10:23
· 11 commits to master since this release

Full Changelog: https://github.com/SwarnenduG07/yt-snap/commits/v1

ytsnap

Fast, lightweight, and independent YouTube video downloader built from scratch

PyPI version
Python 3.8+
License: MIT

πŸš€ Features

  • βœ… No yt-dlp dependency - Built completely from scratch
  • βœ… Fast downloads - Direct CDN access via YouTube's innertube API
  • βœ… Multiple formats - Support for various video qualities and formats
  • βœ… Progress tracking - Real-time download progress with speed indicators
  • βœ… CLI & Library - Use as command-line tool or Python library
  • βœ… Lightweight - Only requires requests library
  • βœ… Python 3.8+ - Wide compatibility

πŸ“¦ Installation

pip install ytsnap

🎯 Quick Start

Command Line

# Basic download
ytsnap "https://www.youtube.com/watch?v=VIDEO_ID"

# Custom output filename
ytsnap "https://www.youtube.com/watch?v=VIDEO_ID" my_video.mp4

# Download specific quality
ytsnap "https://www.youtube.com/watch?v=VIDEO_ID" video.mp4 --quality 720p

# Download by format itag
ytsnap "https://www.youtube.com/watch?v=VIDEO_ID" video.mp4 --itag 18

Python Library

from youtube_downloader import YouTubeDownloader

# Initialize downloader
downloader = YouTubeDownloader("https://www.youtube.com/watch?v=VIDEO_ID")

# Get available formats
formats = downloader.get_formats()
for fmt in formats:
    print(f"itag={fmt['itag']} quality={fmt['quality']} size={fmt['filesize']}")

# Download video (auto-selects best format with video+audio)
downloader.download("video.mp4")

# Download specific quality
downloader.download("video_720p.mp4", quality="720p")

# Download by itag
downloader.download("video.mp4", itag=18)

πŸ”§ How It Works

ytsnap uses YouTube's official innertube API with Android client credentials to fetch direct CDN URLs. This approach:

  • Bypasses complex signature decryption
  • Provides stable and reliable downloads
  • Works without reverse-engineering JavaScript
  • Maintains compatibility with YouTube's infrastructure

πŸ“Š Format Information

The downloader shows available formats with:

  • [V] - Video only
  • [A] - Audio only
  • [V+A] - Combined video and audio (preferred)

Common itags:

  • 18 - 360p MP4 (video + audio)
  • 22 - 720p MP4 (video + audio)
  • 136 - 720p MP4 (video only)
  • 140 - Audio only (M4A)

πŸ› οΈ Development

# Clone repository
git clone https://github.com/yourusername/ytsnap.git
cd ytsnap

# Install in development mode
pip install -e .

# Run tests
python -m pytest

πŸ“ Use Cases

  • Download videos for offline viewing
  • Archive educational content
  • Create video processing pipelines
  • Build custom download managers
  • Integrate into automation scripts

⚠️ Legal Notice

This tool is for personal use only. Respect YouTube's Terms of Service and copyright laws. Only download content you have permission to download.

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

MIT License - see LICENSE file for details

🌟 Why ytsnap?

  • Independent: No reliance on yt-dlp or other heavy dependencies
  • Simple: Clean API, easy to use and integrate
  • Reliable: Uses official YouTube API endpoints
  • Maintained: Built with modern Python practices
  • Fast: Direct downloads without unnecessary overhead

πŸ“ž Support


Made with ❀️ for the Python community