Skip to main content

y2cli

Offline YouTube downloader CLI — works exactly like Y2Mate but runs on your machine with no browser needed. Powered by yt-dlp with ffmpeg bundled via imageio-ffmpeg (no separate ffmpeg install required).

Features

  • Download YouTube videos as MP4 (1080p, 720p, 480p, 360p, and more)
  • Download audio as MP3
  • Interactive format picker (like Y2Mate's UI, in the terminal)
  • Built-in ffmpeg — no manual setup
  • Local HTTP server mode for the VS Code and browser extensions
  • JSON output mode for programmatic use

Install

pip install y2cli

Or install from source:

git clone https://github.com/Tresorbana/y2cli
cd y2cli
pip install -e .

Usage

# Interactive — prompts for URL and format
y2cli

# Pass URL directly, pick format interactively
y2cli "https://www.youtube.com/watch?v=VIDEO_ID"

# Direct download, no prompts
y2cli "https://..." --format mp4_720
y2cli "https://..." --format mp3

# Available format IDs
# mp3, mp4_1080, mp4_720, mp4_480, mp4_360  (depends on video)

# Custom output directory
y2cli "https://..." --format mp4_720 --output "C:\Users\You\Videos"

# Get video info as JSON (used by extensions)
y2cli "https://..." --info

# Start local HTTP server (for VS Code / browser extensions)
y2cli --serve
y2cli --serve --port 8080

Downloads save to ~/Downloads/y2cli/ by default.

HTTP Server API

When running y2cli --serve (default port 7272):

Method Endpoint Body Description
GET /ping — Health check
POST /info {"url": "..."} Get video info + formats
POST /download {"url": "...", "format_id": "mp4_720"} Start download, returns job_id
GET /progress?job_id=... — Poll download progress

License

MIT

Metadata

Release files for y2cli 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for y2cli 1.1.0
File Size Uploaded
y2cli-1.1.0.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for y2cli 1.1.0
File Interpreter ABI Platform
y2cli-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.0 kB

Release files / y2cli-1.1.0.tar.gz

Download URL y2cli-1.1.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8f4f002e86bd9f52fe4fbb7c2e1961525efb6fc19734181f73d09d06ed1ac490
BLAKE2b-256 checksum
How to use checksums
59b7133037671b9c96ea5107c36c70766502bd631ba4bdda9b152566465a292a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / y2cli-1.1.0-py3-none-any.whl

Download URL y2cli-1.1.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79dd95bc2be2dd8a29d5e7075fcfc1f349bcd0e41d9adc57a132203ca8a84baa
BLAKE2b-256 checksum
How to use checksums
a2f18661f806d6c75762a12d9ddd3f6f15037ffc79bd0b9973b7399550ac1253
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

1.1.1

2 release files

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page