ข้ามไปที่เนื้อหา
yt-dlp

ติดตั้ง yt-dlp บน Windows

ติดตั้ง yt-dlp และ ffmpeg บน Windows ด้วย winget, Scoop หรือดาวน์โหลดตรง ๆ แล้วแก้ปัญหา 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 ใด ๆ