Download videos with `yt-dlp` (and quality selection)

The successor to youtube-dl that everyone's muscle memory still gets wrong — the format expression decides whether you get 1080p or a 360p file.

Linuxvideoyt-dlpdownloadLow risk
Run `yt-dlp -f "bv*[height<=1080]+ba/b" URL` to download the best video up to 1080p plus best audio merged automatically.

01Command

Command
$ yt-dlp -f "bv*[height<=1080]+ba/b" "https://www.youtube.com/watch?v=VIDEO_ID"

02What it does

YouTube stores video and audio as separate streams; the expression `bv*+ba/b` asks for best video plus best audio and falls back to a combined stream, and yt-dlp merges them with ffmpeg. Without a format filter you often get a low-resolution combined stream, which is why the flag matters. Frequently forgotten flags: `-x --audio-format mp3` to save audio only, `-o "%(title)s.%(ext)s"` for clean filenames, and `-F URL` to list all available formats first.

03Risk

RiskLow risk
RequirementsRequires yt-dlp (pip install yt-dlp, or distro package); ffmpeg needed to merge separate video+audio streams; YouTube often requires a recent version — update frequently
!Warning: Sites change constantly — if downloads fail, first run `yt-dlp -U` (pip) or upgrade your distro package before assuming the tool is broken. Respect copyright and each site's terms of service.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-17 · Category: Media