Article

How to Download YouTube Videos With yt-dlp

Download YouTube videos with yt-dlp, use predictable filenames, limit quality, update the tool, and troubleshoot errors.

Devin Schumacher4 min read
youtube
yt-dlp
command-line
video-download

yt-dlp is a command-line downloader for people comfortable using a terminal. Copy the individual YouTube watch URL and run:

BASH
yt-dlp "YOUTUBE_VIDEO_URL"

This page is intentionally only about yt-dlp. The browser-extension alternative is at the end.

Install and update it through the official yt-dlp project rather than copying an old package command from a third-party article.

Install what YouTube support needs

The current yt-dlp documentation lists two additional pieces for full YouTube support:

  • the yt-dlp-ejs component
  • a supported JavaScript runtime, with Deno as the recommended option

Follow the project’s current installation instructions for the setup that matches your operating system and installation method.

FFmpeg is also strongly recommended. YouTube often supplies the best picture and sound as separate streams, and yt-dlp uses FFmpeg to combine them into one finished file.

Use a clear filename

BASH
yt-dlp -o "%(title)s-%(id)s.%(ext)s" "YOUTUBE_VIDEO_URL"
PartMeaning
%(title)sYouTube video title
%(id)sYouTube video identifier
%(ext)sFinal file extension

Choose a maximum quality

Current yt-dlp releases can sort the available formats by a maximum resolution. To prefer a result no higher than 1080p:

BASH
yt-dlp -S "res:1080" "YOUTUBE_VIDEO_URL"

Combining the chosen picture and sound may require FFmpeg. Follow the project’s current installation instructions for yt-dlp and its recommended dependencies.

For a first test, use the basic command and let yt-dlp choose.

Save to a chosen folder

Use -P to choose the download folder and -o to control the filename.

On macOS or Linux:

BASH
yt-dlp -P "$HOME/Downloads/YouTube" -o "%(title)s.%(ext)s" "YOUTUBE_VIDEO_URL"

On Windows PowerShell:

POWERSHELL
yt-dlp -P "$HOME\Downloads\YouTube" -o "%(title)s.%(ext)s" "YOUTUBE_VIDEO_URL"

Create the folder first if needed.

Update before troubleshooting

YouTube changes frequently. An old yt-dlp build may stop recognizing working videos.

The yt-dlp project currently recommends its nightly channel for regular users because extractor fixes reach it sooner. If you installed an official standalone build, update it with:

BASH
yt-dlp -U

If the stable channel still fails on a working video, switch that build to nightly:

BASH
yt-dlp --update-to nightly

Then retry the individual watch URL.

Package-manager installations should be updated through the same package manager. Use the project’s official installation page for the current nightly command for that installation method.

Download a playlist

yt-dlp can read a playlist URL. Use an output name that keeps the list order:

BASH
yt-dlp -o "%(playlist_index)02d-%(title)s.%(ext)s" "YOUTUBE_PLAYLIST_URL"

Review the playlist first so you know how many available videos to expect.

Common errors

Unsupported URL

Copy the individual YouTube watch URL rather than a search or channel page. Update yt-dlp and retry.

Video unavailable

Open the link in your browser. The upload may be private, removed, restricted, or opened under the wrong account.

Requested format is not available

The quality rule asks for an option the video does not provide. Try the basic command or lower the limit.

FFmpeg not found

Install FFmpeg from its official instructions, restart the terminal, and retry.

JavaScript runtime or EJS component missing

Revisit the official installation instructions and confirm that the yt-dlp-ejs component and a supported JavaScript runtime are available. Deno is the project’s recommended runtime.

Command not found

yt-dlp is not installed in a location the terminal recognizes. Revisit the official installation steps for your system.

Verify the downloaded file

Open the result and check the title, duration, picture, sound, beginning, and ending. For a long video, seek to several points.

If the file is incomplete, confirm YouTube itself plays the whole video, update yt-dlp, and make one fresh attempt.

Browser-extension alternative

The SERP YouTube Video Downloader works from the watch page with a visible quality picker and browser progress. It is simpler for people who do not want terminal commands.

Use the main YouTube download guide for that workflow. Choose yt-dlp for command-line control; open YouTube Video Downloader for a point-and-click download beside the video.

Related products

Tools that directly support the workflow covered in this article.

Download YouTube videos entirely on your device with no telemetry—your viewing and download activity stays completely private.

Download YouTube videos from the watch page, choose an available quality, and save the completed file to your computer.

Read article

Learn when yt-dlp works with a Skool video provider URL, why lesson links often fail, and which workflow fits each player.

Read article

Step-by-step guide to download Coursera videos using yt-dlp by extracting MP4 or HLS/DASH stream URLs from the Network tab in DevTools.

Read article