What Is yt-dlp?

A feature-rich command-line tool and Python library for downloading video and audio from YouTube and thousands of other sites

yt-dlp is a feature-rich command-line tool (and Python library) for downloading video and audio from YouTube and thousands of other supported sites, with fine-grained control over format, quality, and output.

What it actually does

yt-dlp "https://www.youtube.com/watch?v=example"          # download best quality
yt-dlp -x --audio-format mp3 "https://..."                 # extract audio only
yt-dlp -f "bestvideo[height<=720]+bestaudio" "https://..."  # specific quality

yt-dlp handles format selection (specific resolutions, audio-only extraction, container formats), subtitle downloading, playlist handling, and metadata extraction across a very large list of supported sites — not just YouTube, despite the name recognition being strongest there.

Using it as a Python library

Beyond the command line, yt-dlp is importable directly into Python code:

import yt_dlp

with yt_dlp.YoutubeDL({"format": "best"}) as ydl:
    ydl.download(["https://www.youtube.com/watch?v=example"])

This makes it usable inside a larger script or application — batch-processing a list of URLs, inspecting available formats before choosing one programmatically, or integrating downloads into a bigger pipeline — rather than being limited to one-off shell commands.

How it relates to youtube-dl

yt-dlp is a fork of the older youtube-dl project, created specifically to add features and merge fixes faster than the original project’s maintenance pace allowed. It’s generally the more actively maintained of the two today, with broader site support and more frequent updates tracking platform changes.

The tool itself is legal, open-source software with legitimate uses (archiving your own content, downloading material you have rights to, working with permissively-licensed video). Whether downloading any specific piece of content is permitted depends on that content’s copyright status and the platform’s terms of service — the tool doesn’t change what’s legally permissible to download and redistribute.

Frequently Asked Questions

What is yt-dlp used for?

Downloading video and audio from YouTube and thousands of other supported sites, from the command line or as a Python library — selecting specific formats/qualities, extracting audio only, downloading subtitles, and more.

Can you use yt-dlp inside a Python script?

Yes — beyond its command-line interface, yt-dlp is importable as a Python library, letting you trigger downloads, inspect available formats, and handle the results programmatically rather than only via shell commands.

Is yt-dlp legal to use?

The tool itself is legal open-source software; whether downloading a specific video is permitted depends on that content’s terms of service and copyright status. Downloading content you don’t have rights to distribute or reuse can violate the platform’s terms or copyright law, regardless of the tool used.

How is yt-dlp different from youtube-dl?

yt-dlp is a fork of the older youtube-dl project, created to add features and fixes faster than the original project’s maintenance pace allowed. It’s generally the more actively maintained option today, with broader site support and more frequent updates.