CLI Usage

ytdlp-nodejs comes with a powerful Command Line Interface (CLI) that supports both interactive and non-interactive modes.

Interactive Mode

Simply run the command without arguments to start the interactive menu:

1npx ytdlp
2# or if installed globally
3ytdlp

This will launch a beautiful interactive menu where you can:

  • Download videos with quality selection
  • Download audio with format selection
  • Get formatted video information
  • Update yt-dlp binary
  • Download FFmpeg binaries

Interactive Commands

These commands will prompt you for additional options interactively:

Download Video

1ytdlp download <url>

You'll be prompted to:

  1. Select video quality (4K, 1080p, 720p, etc.)
  2. Enter optional extra arguments (e.g., --embed-subs)

Download Audio

1ytdlp audio <url>

You'll be prompted to:

  1. Select audio format (MP3, M4A, WAV, or Best Quality)
  2. Enter optional extra arguments

Get Video Info

1ytdlp info <url>

Displays formatted video information including title, uploader, duration, views, and more.

Direct Commands

These commands run without interactive prompts:

List Formats

List all available formats for a video:

1ytdlp formats <url>

Download with Specific Quality

Download directly with a specific quality (non-interactive):

1ytdlp video <url> --quality 1080p

Download FFmpeg

Download FFmpeg binaries to the project:

1ytdlp ffmpeg

Update yt-dlp

Update the internal yt-dlp binary:

1ytdlp update

Examples

Quick interactive download

1ytdlp download https://youtube.com/watch?v=dQw4w9WgXcQ
2# Select quality from menu → Downloads video

Direct audio download

1ytdlp audio https://youtube.com/watch?v=dQw4w9WgXcQ
2# Select MP3 → Downloads as audio

Get video information

1ytdlp info https://youtube.com/watch?v=dQw4w9WgXcQ
2# Displays formatted video details