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.1

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.1
File Size Uploaded
y2cli-1.1.1.tar.gz 8.3 kB Details

Built distribution (wheel)

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

Total release size: 17.0 kB

Release files / y2cli-1.1.1.tar.gz

Download URL y2cli-1.1.1.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
400d88257056cc1a1ddb58e5cf6cb0f41da434ae73be33f305b39802e2ad89c2
BLAKE2b-256 checksum
How to use checksums
9ebc053c19df8c6ef669be97e3dfb654e95786b720a561c7ae368a9110801827
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.1-py3-none-any.whl

Download URL y2cli-1.1.1-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7a2689250649feac69ba5c58ea84bea6f5a993f52fb47157ce3eb82e962f305
BLAKE2b-256 checksum
How to use checksums
a926af3d3686599388fcd0970e52cfe0886242ee1adfe7b416bdfc4162682d50
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

This release

1.1.1 This release

2 release files

1.1.0

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