How to download video and audio from the web with a command-line tool
yt-dlp is a command-line program that downloads video and audio from thousands of websites. You give it a URL and it returns the file, byte-identical to the source. It supports 1,755 sites, needs no account or API key, and runs as a standalone Windows executable (22.5 MB) or via Python 3.11+. It has 209,475 GitHub stars, 755,767 daily PyPI downloads, and updates frequently. For YouTube it requires a JavaScript runtime (deno) and the official challenge script, otherwise formats are missing. It grants no usage rights — many services' terms prohibit downloading.

How to download video and audio from the web with a command-line tool
Two words first
You see a video on the web and you want to keep it on your disk. Maybe to watch offline, to edit, to extract the audio, or simply because you know it might be gone tomorrow. You open a terminal, type the page URL, and the file appears in your folder. No menus, no buttons, no popup asking for a subscription. That is what yt-dlp does — it turns a URL into a file.
The name comes from youtube-dl, the original project from which it forked in 2020. yt-dlp stands for youtube downloader plus — the plus shows it added support for far more sites, faster updates, and options the older program lacked. Today it is the default choice for anyone who wants to download from the web with a command.
Without a graphical interface, without an account, without API keys. One command, one file. That simplicity is exactly what makes it reliable: fewer things to break, fewer failure points. When you work with software that changes every day — because the services change every day — simplicity is the only thing that survives.
What it does
yt-dlp takes a web URL and returns the video or audio file it finds there. It supports 1,755 sites — measured with yt-dlp --list-extractors — including YouTube, Vimeo, Twitch, Twitter, Facebook, Instagram, TikTok, SoundCloud, Bandcamp, and thousands of others. For each site it knows how to locate the video stream, how to bypass protections, and how to stitch the pieces together if the video is segmented.
It gives quality control to the user. You can ask for the best available quality, a specific resolution, audio only, video without audio, or see the list of all available formats before deciding. It saves metadata: title, description, upload date, tags, thumbnail, subtitles, and writes them to a JSON file if requested. It can download entire playlists, channels, or just print titles without downloading anything.
The file it produces is byte-identical to what the source serves. In our test a 2-second video, 5,328 bytes, served from a local server, downloaded and the result had the same sha256 hash: 10c6fabd430934500358ecc90a4cf0bc0509d20ed00de633091d5bd5a10eb98d. The tool does not re-encode, does not transcode, does not lose data — it downloads exactly what is there.
It runs anywhere Python 3.11 or newer runs. There is also a standalone Windows executable: yt-dlp.exe, 23,575,744 bytes (about 22.5 MB), with 1,896,157 downloads to date. This means on Windows you need no Python at all — download the .exe, put it in a folder on PATH, and it works. On Linux and macOS it installs via pip, pipx, or the distro package managers.
It updates constantly. The latest PyPI version is 2026.10.26, published 2026-10-26. The GitHub repository has 209,475 stars, 18,499 forks, 2,793 open issues, first release 2020-10-26, last change 2026-11-21. PyPI downloads measured 2026-11-21: 755,767 daily, 5,159,375 weekly, 22,250,492 monthly. The license is Unlicense — public domain, no restrictions.
The extractor architecture is the secret of its continued operation. Each site has its own extractor — a small piece of code that knows the internal structure of the page, its endpoints, the headers it wants, the encryption it uses. When a service changes, only that extractor changes. The rest works unchanged. That is why yt-dlp endures: it is not one piece of code that breaks, it is hundreds of small pieces that update independently.
The PyPI download numbers speak for themselves: 755,767 daily, 5,159,375 weekly, 22,250,492 monthly. These are not statistics — they are proof that thousands of people use it daily, in production, in scripts, in CI/CD pipelines, on headless servers.
Both halves of that simplicity have a practical consequence. Because it runs from a command and writes its result to a file, yt-dlp fits inside other things: a nightly script that keeps a local copy of a playlist, an automation job, a machine with no screen. That is what separates it from a browser extension, which needs a person to press a button. And because the output is the file itself and nothing else, there is no hidden conversion, no locked format, and no account holding your history.
What it does not do
It does not solve the YouTube challenge without external help. Modern YouTube requires a JavaScript runtime to decrypt streams. yt-dlp needs deno installed on the system and the official challenge solver script (extractor) to see all available formats. Without them our test produced the warning No supported JavaScript runtime could be found followed by ERROR: Requested format is not available — meaning formats are missing. This is a tool requirement for full YouTube support, not a user mistake.
It grants no usage rights. It downloads the file, and the terms of service of many services (YouTube, Vimeo, Netflix, Spotify, and others) prohibit downloading and storing without permission. The fact that the tool can do it does not make it legal or permitted. The reader assumes responsibility for what they download and how they use it.
It is not a video processor. It does not transcode, does not change codecs, does not cut, does not join files — it only downloads. If you want to convert to MP4, change bitrate, cut a segment, you need ffmpeg separately. yt-dlp can call ffmpeg automatically for some operations (e.g. merging separately downloaded video and audio), but yt-dlp itself does no processing.
It does not bypass DRM. If a service uses digital rights management (Widevine, PlayReady, FairPlay), yt-dlp cannot download the content. It will error or download only unprotected streams.
It does not work on pages that require login with cookies or tokens you do not provide. You can pass cookies from a browser (--cookies-from-browser) or file (--cookies), but if the page demands interactive login (2FA, CAPTCHA, device prompt), yt-dlp stops.
It is not a graphical interface. It has no windows, buttons, menus, drag-and-drop. If you want a GUI, there are tools built on top of yt-dlp (e.g. yt-dlp-gui, Tartube), but yt-dlp itself is and remains a terminal tool. This is not a drawback — it is a design choice that makes it scriptable, reproducible, and lightweight.
It does not guarantee availability. A site that works today may not work tomorrow. Extractors are usually updated within hours or days, but there is a window where the tool returns an error. ERROR: Unable to extract means that site's extractor needs updating, not that yt-dlp is broken.
One more thing worth knowing before you run it: yt-dlp is not stable against changes made by the sites it serves. When a site alters its structure, the tool stops working there until an update lands — usually within hours or days, because the community maintaining it moves fast. The program can update itself: with the standalone Windows build, yt-dlp -U fetches the new version. The lesson from our test is that "it did not download" does not always mean "it cannot" — it often means "update and try again".
Installation
Standalone Windows executable (recommended for Windows)
curl -L -o yt-dlp.exe https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe
Then move it to a folder on PATH (e.g. C:\Windows or C:\Users\<user>\bin) and run yt-dlp directly.
Python with pip (Linux, macOS, Windows with Python)
pip install -U yt-dlp
Requires Python 3.11 or newer. Latest PyPI version is 2026.10.26.
Python with pipx (isolated environment, recommended for CLI tools)
pipx install yt-dlp
Arch Linux
pacman -S yt-dlp
Debian / Ubuntu (from distro repository, may be older version)
apt update && apt install yt-dlp
Fedora
dnf install yt-dlp
macOS with Homebrew
brew install yt-dlp
macOS with MacPorts
port install yt-dlp
FreeBSD
pkg install yt-dlp
Docker (isolated environment, useful in CI/CD)
docker pull ghcr.io/yt-dlp/yt-dlp:latest
Then run with docker run --rm -v $(pwd):/data ghcr.io/yt-dlp/yt-dlp:latest [commands].
For YouTube: deno and challenge script
For full YouTube support: install deno (https://deno.land/) and ensure the challenge solver script is available — yt-dlp downloads it automatically if missing, but needs deno to run it. Without deno you see only a subset of formats.
Usage
Show version
yt-dlp --version
Download video by URL only
yt-dlp "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
List available formats before downloading
yt-dlp --list-formats "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
Select specific format (e.g. best video up to 1080p and best audio)
yt-dlp -f "bv*[height<=1080]+ba/b[height<=1080]" "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
Audio only, best quality, saved as MP3 (requires ffmpeg)
yt-dlp -x --audio-format mp3 "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
Save metadata to JSON
yt-dlp --write-info-json "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
Save thumbnail
yt-dlp --write-thumbnail "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
Download entire playlist
yt-dlp "https://www.youtube.com/playlist?list=PLexAmPleLiSt"
Playlist titles only, no download
yt-dlp --flat-playlist --print "%(title)s" "https://www.youtube.com/playlist?list=PLexAmPleLiSt"
Download with cookies from browser (for content requiring login)
yt-dlp --cookies-from-browser chrome "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
Extract subtitles (if available)
yt-dlp --write-subs --sub-langs en,el "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
Output path with naming template
yt-dlp -o "%(uploader)s/%(title)s.%(ext)s" "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
Error on non-existent URL
Error on non-existent URL returns exit code 1 and message Unable to download webpage — it does not fail silently.
What it costs
Keeping this tool costs you no subscription and no tokens. yt-dlp is a command-line program, not a tool server: it is never declared to a model, it loads no schemas, and it takes no room in any conversation's context — zero context tax. A tool server, by contrast, sends the description of every tool it offers before you have even asked anything; here there is nothing to send. That is not a token measurement — it follows from how the tool works.
Its weight is real but small, and you choose how much: from PyPI the package is 3,186,201 bytes (about 3.0 MB) and the source archive 3,048,880 bytes (about 2.9 MB), while the standalone Windows executable is 23,575,744 bytes (about 22.5 MB) and needs no Python at all. To merge video and audio at high quality it asks for ffmpeg, which is a separate program.
Money: zero. The licence is Unlicense, meaning the code belongs to the public domain — you use it, change it and share it with no permission and no attribution required. The real cost is your time and the bandwidth that the file you download consumes; the tool adds nothing on top of that.
Verdict
yt-dlp is the most capable command-line downloader for the web. It supports more sites than any alternative, updates faster than the services break it, and gives you precise control over what you get. The standalone Windows executable makes it trivial to start. The YouTube JavaScript requirement is a real friction point — you need deno and the challenge script for full format access — but once set up it works. The license is public domain, the code is open, and the community is active. It does not grant rights; it only downloads. Use it knowing what the source terms allow.
Sources
https://github.com/yt-dlp/yt-dlp#readme
https://github.com/yt-dlp/yt-dlp
https://github.com/yt-dlp/yt-dlp/releases
Εγκατάσταση
2 ΒΗΜΑΤΑ- curl -L -o yt-dlp.exe https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe
- pip install -U yt-dlp