What is yt-dlp?

yt-dlp is a free command line program that downloads videos and audio from YouTube and thousands of other sites. It runs on Windows, macOS and Linux. It needs FFmpeg to join the separate video and audio streams most sites send, to convert audio and to embed thumbnails, and YouTube downloads also need Deno. yt-dlp has hundreds of options, so a basic download often means looking up the same few flags again.

Tool description

This tool writes a yt-dlp command for a basic download. Paste the link of a video or playlist, or several links separated by spaces, and pick:

  • Download: the video, or only its audio
  • File type: Any, MP4 or MKV for video, or Original, MP3, M4A, Opus, FLAC or WAV for audio. Original keeps the audio the site sends, usually Opus or M4A on YouTube, without converting it
  • Quality: the highest resolution, from 2160p (4K) down to 360p, or a bitrate for MP3, M4A and Opus. Best gets the best the site has
  • Folder: where the files go. Leave it empty for the folder you run the command in
  • File name: the title with the video ID in brackets, as yt-dlp names files by default, or only the title

Under Options you can embed subtitles, the thumbnail and metadata such as the title, channel and chapters in the file, and ignore the playlist when a video link also points to one, so only that video downloads. Subtitles are the ones the uploader added, in English if there are any.

MP4 prefers H.264 video and AAC audio, which play everywhere. YouTube only has H.264 up to 1080p, so for higher resolutions the MP4 holds VP9 or AV1 video, which some older players and video editors can't open. MKV keeps the best streams as they are.

The command is built in your browser. Copy it and run it in a terminal.

Examples

A video in MP4, no larger than 1080p:

yt-dlp -t mp4 -S "res:1080" "https://www.youtube.com/watch?v=aqz-KE-bpKQ"
Shell

The audio as an MP3 with its thumbnail as cover art, saved in a Music folder:

yt-dlp -x --audio-format mp3 --audio-quality 0 --embed-thumbnail --embed-metadata -P "~/Music" "https://www.youtube.com/watch?v=aqz-KE-bpKQ"
Shell

Features

  • Video quality from 360p to 4K, or audio bitrate
  • MP4 and MKV video, MP3, M4A, Opus, FLAC and WAV audio
  • Subtitles, thumbnail and metadata embedding
  • Download folder and file name
  • Several links in one command