dl-yt
v1.0.1
Published
Download YouTube videos from the terminal using npx, bunx, or npm
Maintainers
Readme
yt-downloader
Download YouTube videos from the terminal. No installation required — run with npx, bunx, or install globally via npm.
Built on yt-dlp (via youtube-dl-exec) with a bundled ffmpeg binary.
Features
- Run instantly with
npx yt-downloader <url> - Interactive quality picker when no format flags are provided
- CLI flags for resolution, format ID, quality presets, and output path
- Real-time download progress bar
- Bundled ffmpeg — no separate install needed
Requirements
- Node.js 18 or later
Installation
# Run without installing
npx yt-download <url>
# Or with Bun
bunx yt-download <url>
# Install globally
npm install -g yt-downloadUsage
Interactive mode
When no quality flags are passed, an interactive menu lets you pick from available resolutions:
npx yt-download https://www.youtube.com/watch?v=dQw4w9WgXcQWith flags
# Download at 1080p
npx yt-download <url> --resolution 1080
# Download best available quality
npx yt-download <url> --quality best
# Download audio only
npx yt-download <url> --audio-only
# Use a specific yt-dlp format ID
npx yt-download <url> --format-id 137
# Custom output directory and filename
npx yt-download <url> -o ~/Videos --filename "%(title)s.%(ext)s"
# Disable progress bar
npx yt-download <url> --no-progressOptions
| Flag | Description | Default |
|------|-------------|---------|
| <url> | YouTube video URL (required) | — |
| -f, --format-id <id> | yt-dlp format ID (highest priority) | — |
| -r, --resolution <height> | Target video height in pixels (720, 1080, 2160) | — |
| -q, --quality <preset> | Preset: best, 1080, 720, audio-only | — |
| -o, --output <dir> | Output directory | ~/Videos |
| --filename <template> | Output filename template (yt-dlp syntax) | %(title)s.%(ext)s |
| --audio-only | Download audio only | false |
| --no-progress | Disable progress bar | progress enabled |
| -h, --help | Show help | — |
| -V, --version | Show version | — |
Format selection priority
When multiple quality flags are provided, only the highest-priority one is used:
--format-id--resolution--quality
If none of the above are set, the interactive menu is shown (unless --audio-only is passed).
--audio-only always downloads audio regardless of other quality flags.
Testing
npm testUses the built-in Node.js test runner (node:test) — no extra test dependencies required.
