How to Use yt-dlp: A Practical Guide (2026)

A practical guide to using yt-dlp — install it, download a video, pick the format and quality, extract audio to MP3, and handle the errors that come up. With copy-paste commands.

Dalvo · Updated July 17, 2026

yt-dlp is the most capable command-line YouTube (and 1,000+ other sites) downloader — a maintained fork of the discontinued youtube-dl. This guide covers the commands you'll actually use day to day: installing, downloading, choosing formats, extracting audio, and dealing with the errors that inevitably come up.

Install yt-dlp

python3 -m pip install -U "yt-dlp[default]"

yt-dlp needs ffmpeg for merging high-quality video+audio and for audio conversion — install it too (brew install ffmpeg, apt install ffmpeg, or grab a build for Windows). Full details in our install guide.

Download a video

The simplest possible command downloads the best available quality:

yt-dlp "https://www.youtube.com/watch?v=VIDEO_ID"

Always quote the URL

YouTube URLs contain & and ?, which your shell will otherwise interpret. Wrap the URL in quotes every time.

Choose the format and quality

List everything available for a video, then pick by format ID:

yt-dlp -F "https://www.youtube.com/watch?v=VIDEO_ID"

More often you just want to cap the resolution. Use the -S (sort) flag:

yt-dlp -S "res:1080" "https://www.youtube.com/watch?v=VIDEO_ID"

Extract audio (MP3)

To grab just the audio and convert it to MP3 (needs ffmpeg):

yt-dlp -x --audio-format mp3 --audio-quality 0 "https://www.youtube.com/watch?v=VIDEO_ID"

More audio options in the audio-only guide.

Handy options you'll reuse

# Name files predictably
yt-dlp -o "%(title)s.%(ext)s" URL

# Download subtitles (and auto-generated captions)
yt-dlp --write-subs --write-auto-subs --sub-lang en URL

# Download a whole playlist
yt-dlp "https://www.youtube.com/playlist?list=PLAYLIST_ID"

# Download just a section
yt-dlp --download-sections "*00:01:30-00:02:45" URL

A fuller list lives in the commands cheat sheet.

Keep it updated

YouTube changes constantly and breaks older yt-dlp builds, so update often:

yt-dlp -U   # or: pip install -U "yt-dlp[default]"

See the update guide if -U doesn't work for your install method.

When it stops working

Two errors dominate, and both are YouTube's bot defenses rather than a mistake in your command:

  • Sign in to confirm you're not a bot → see the fix guide
  • HTTP Error 403: Forbidden → see the 403 fix guide

Both usually come down to updating yt-dlp, passing cookies, or getting off a flagged IP.

Just need the file, not the setup?

Paste a YouTube URL and download it here — no install, no flags, no bot blocks.

Paste a link. See it work.

Paste a YouTube link, pick a format, and hit download.

More formats (720p, 1080p, trimming, language) are available through the API.

When to use an API instead

yt-dlp is excellent for local, one-off, and hobby use. But running it in production means owning a moving target: re-updating every couple of weeks, rotating cookies, managing proxies, and patching around YouTube's changes. If downloading YouTube is a feature of your product, a managed API removes that maintenance entirely.

Skip the yt-dlp maintenance treadmill.

Send a URL, get a direct download from our CDN. We keep it working as YouTube changes — no updates, cookies, or proxies on your side.

Start free

Frequently asked questions

Is yt-dlp the same as youtube-dl?+

yt-dlp is an actively maintained fork of youtube-dl with many more features, faster fixes, and better format handling. youtube-dl still exists but updates far more slowly, so most people use yt-dlp today.

Do I need ffmpeg?+

For the highest-quality downloads yes — YouTube serves video and audio as separate streams, and yt-dlp uses ffmpeg to merge them. ffmpeg is also required to convert audio to MP3.

Why does yt-dlp download low quality by default?+

It doesn't intentionally, but without ffmpeg it can only grab pre-merged streams, which top out lower. Install ffmpeg and use a format selector like -S "res:1080" to control quality.