Skip to main content

A wrapper for yt-dlp with custom simple fetching flags

Project description

ytfetch

ytfetch simplifies media downloading and playlist management by adding smart Fetching, playlist searching, and streamlined format handling on top of the powerful yt-dlp engine.

✨ Features

  • Smart Fetching: Apply limits to multiple playlists or map specific ranges in a single download.
  • Search: Use -list to display or search across single or multiple playlists contents.
  • Direct Download: Single flag to download in legacy avc/h.264 and mp3 format and audio only extraction.
  • Video Quality: Mention preffered video quality directly.
  • Native Compatibility: Can also pass through any yt-dlp flag.
  • Minimal Output logs: Clean and minimal logs.

📋 Requirements

  • Python: 3.8 or higher.

  • FFmpeg and FFprobe: Should available in your system PATH. Download builds from here

    or
    • On Windows:

      winget install BtbN.FFmpeg.GPL
      

      or

      winget install Gyan.FFmpeg
      
    • On Termux (android):

      pkg install ffmpeg
      
    • On Mac (using Homebrew):

      brew install ffmpeg
      
    • On Arch Linux:

      sudo pacman -S ffmpeg
      
    • On Ubuntu/Debian:

      sudo apt install ffmpeg
      
  • Deno: Or other JavaScript runtime/engine like node.js or bun

    Check this guide for more info. Also check yt-dlp dependency for optional dependencies.

Note: yt-dlp should also be available in your system PATH for using the -list flag. If the package is installed in a virtual environment (venv) or isolated using tools like uv, ensure yt-dlp added to your system env PATH.

📦 Installation

via pip

pip install ytfetch

via source

git clone https://github.com/voidsnax/ytFetch.git
cd ytFetch
pip install -e .

🚀 Usage

General Syntax and Options

usage: ytfetch URL ... [OPTIONS] [yt-dlp OPTIONS]

options:
  -h                         Show this help message and exit
  -help                      Show yt-dlp help message
  -avcmp3                    Download video in AVC (h.264) & audio in mp3 format
  -q QUALITY                 Video quality (e.g., 1080, 720). Default is 1080
  -mp3                       Extract audio only as MP3
  -audio                     Extract audio only
  -fetch RANGE [RANGE ...]   Alternate for --playlist-items. Single value applies globally
                             Multiple value must match number of playlist URLs provided
  -list [NAME]               List playlist contents. Accepts values for searching across playlist

Examples

Basic Downloading

Download a video at the default best quality

ytfetch "VIDEO_URL"

Download a video in 720p

ytfetch "VIDEO_URL" -q 720

Format Conversion

Download as AVC(H.264) and Mp3 in MP4 Container

ytfetch "VIDEO_URL" -avcmp3

Extract Audio Only in Mp3

ytfetch "VIDEO_URL" -mp3

Smart Fetching

Global Limit

ytfetch "PLAYLIST_URL_1" "PLAYLIST_URL_2" -fetch "1-10"

Mapped Ranges

ytfetch "PLAYLIST_A" "PLAYLIST_B"  -fetch "1-5" "10-15"

Note: The number of fetch arguments must match the number of URLs

Listing and Searching

List a Playlist

ytfetch "PLAYLIST_URL" -list

Search through a playlist

ytfetch "PLAYLIST_URL" -list "remix"

Combined Fetch & Search

ytfetch "PLAYLIST_URL"  -fetch ":50" -list "search_word"

Passthrough Options

You can append any standard yt-dlp option to your command. Both long and short flags are supported.

Download via Proxy

ytfetch --proxy "socks5://127.0.0.1:1080" "VIDEO_URL"

Use Cookies

ytfetch --cookies "cookies.txt" "VIDEO_URL"

Limit Speed

ytfetch -r "500K" "VIDEO_URL"

🔖 License

MIT License

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

ytfetch-1.2.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

ytfetch-1.2.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file ytfetch-1.2.0.tar.gz.

File metadata

  • Download URL: ytfetch-1.2.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ytfetch-1.2.0.tar.gz
Algorithm Hash digest
SHA256 731154c34dc6f912ef16b85b1ddf58aefdb7a4ae58ca3790603db07f88057ce8
MD5 a37b0e68c9d50ced6faacbfd21cf2294
BLAKE2b-256 fc098f2c4abfc0f59205933a80e1c30f357f1be592d0bcd754c4166cc8c4174d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytfetch-1.2.0.tar.gz:

Publisher: publish.yaml on voidsnax/ytFetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ytfetch-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: ytfetch-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ytfetch-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 669b8a69975917af9a6cc565e71165014c795e847b04bd4627ca401ab7155f25
MD5 3868c5a9ce7cefb3517340160d42e4c3
BLAKE2b-256 a2e59390a48d5575e1e157cd9374856f8d76a24b981bca6277828be94b3ae1bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytfetch-1.2.0-py3-none-any.whl:

Publisher: publish.yaml on voidsnax/ytFetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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