跳到正文
yt-dlp

在 Windows 上安装 yt-dlp

用 winget、Scoop 或直接下载在 Windows 上安装 yt-dlp 和 ffmpeg,并解决随后出现的 PATH 报错。

这篇文章还没有翻译,所以以英文显示。界面部分仍是你的语言。

1. Install yt-dlp

winget ships with Windows 10 and 11 and handles the PATH for you, which is the part people get wrong when installing by hand.

winget install yt-dlp.yt-dlp

If you already use Scoop or Chocolatey, either is equally fine:

scoop install yt-dlp
choco install yt-dlp

The manual route is a single yt-dlp.exe from the official releases page. Put it in a folder that is on your PATH — dropping it on the Desktop works only while your terminal happens to be in that folder, which is the usual cause of "yt-dlp is not recognized".

2. Install ffmpeg

yt-dlp downloads without ffmpeg, but everything interesting needs it: merging separate video and audio, MP3 extraction, embedding subtitles or thumbnails, cutting sections. Install it now rather than after the first confusing failure.

winget install Gyan.FFmpeg

3. Check it worked

Open a new terminal — an existing one still has the old PATH — and run:

yt-dlp --version
ffmpeg -version

Two version numbers means you are done.

Quoting on Windows

PowerShell and cmd do not quote the way bash does, and a command copied from a Linux-oriented tutorial often breaks for exactly this reason. In PowerShell, single quotes are literal — the safest choice for a format selector or an output template. In cmd, use double quotes. In a .bat file, every % must be doubled.

yt-dlp -o '%(title)s.%(ext)s' URL     # PowerShell
yt-dlp -o "%(title)s.%(ext)s" URL     # cmd
yt-dlp -o "%%(title)s.%%(ext)s" URL   # inside a .bat file

The generator's shell switch produces the right form for each of these, so you can copy without translating.

Updating

A standalone yt-dlp.exe updates itself with yt-dlp -U. Installed via winget, Scoop or Chocolatey, update it through the same tool — self-update will refuse, because the package manager owns the file.

常见问题

Windows 说找不到 yt-dlp,为什么?
可执行文件不在 PATH 里,或者终端是在安装之前就打开的。先开一个新终端;如果还不行,就用 winget 或 Scoop 安装,它们会替你处理 PATH。
Windows 上 yt-dlp 找不到 ffmpeg。
用 winget install Gyan.FFmpeg 安装,打开新终端,再用 ffmpeg -version 检查。把 ffmpeg.exe 放在 yt-dlp.exe 同一目录里也行。
怎么更新 yt-dlp?
独立的二进制文件用 yt-dlp -U 自我更新。如果是通过包管理器安装的,就用那个管理器更新;自我更新会拒绝改动不属于它的文件。更新能解决的问题比任何 flag 都多。