yt-dlp 教學 2026|Windows 安裝、YouTube 4K/8K 下載與 MP3 轉檔

yt-dlp 教學 2026|Windows 安裝、YouTube 4K/8K 下載與 MP3 轉檔

早些時間有收集一些Youtube Downloader,隨著Youtube的更版與限制。
這些原本可以下載的網頁慢慢地消失或者無法下載大於720p的影音。
360P就不用提了,畫質太低無法滿足需求。
還有好有yt-dlp,以 Python 開發的開源影片下載工具,主要用來從 YouTube 以及上千個影音網站下載影片與音訊,是目前下載的主流工具之一。




閱讀全文: yt-dlp 教學 2026|Windows 安裝、YouTube 4K/8K 下載與 MP3 轉檔

yt-dlp 安裝教學(windows)

Windows 安裝 yt-dlp(含 PATH 設定)

下載 yt-dlp(Windows 版)

下載 yt-dlp(Windows 版)
官方 GitHub Releases:
到Lastest 版本

yt-dlp

截至本文更新日期,yt-dlp 最新 Stable Release 為 2026.10.26

由於影音網站經常調整播放方式、串流格式與驗證機制,因此建議定期檢查 yt-dlp 版本。

安全提醒: yt-dlp 於 2026/10/21 發布的版本包含舊版執行檔安全性提醒。若使用過時版本且懷疑下載或更新過程遭到攔截,建議直接從官方 GitHub 重新取得新版執行檔。

下載 yt-dlp.exe

yt-dlp

建議將 yt-dlp.exe 與 FFmpeg 放在專用資料夾,例如:

D:\tools\yt\
├── yt-dlp.exe
├── ffmpeg.exe
└── ffprobe.exe

如何更新 yt-dlp?

如果使用官方獨立執行檔,可先確認版本:

yt-dlp --version

官方執行檔支援:

yt-dlp -U

不過,如果目前安裝的是受安全公告影響的過時版本,或懷疑執行檔已遭到竄改,建議直接由官方 GitHub 重新下載新版執行檔。

安裝 ffmpeg

到FFmpeg Builds binaries for Windows

下載 ffmpeg-git-full.7z

yt-dlp

解壓後取得ffmpeg.exe 檔案放入同一資料夾:
D:\tools\yt\ffmpeg.exe

輸入ffmpeg -version看有沒有顯示版本資訊

ffprobe -version
yt-dlp

FFmpeg 主要負責影音合併、轉檔與後製,FFprobe 則可協助檢查影音格式資訊。

加入 PATH

系統 → 進階系統設定 → 環境變數
編輯 Path

yt-dlp
yt-dlp
yt-dlp
yt-dlp

加入環境變數變數之後,可以從任何工作目錄執行 yt-dlp。

確認 yt-dlp 版本

yt-dlp --version

正常情況下,會顯示目前安裝的版本,例如:

2026.10.26

以上是版本輸出格式的示例,實際結果以安裝版本為準。

指令說明

yt-dlp必須透過終端機打指令下載,因此了解操作方式是必要的,以下列出常用的指令說明

下載「最高畫質 + 有聲音」(自動合併)

yt-dlp -f "bv*+ba/b" URL

強制輸出 MP4(相容性最好)

yt-dlp -f "bv*+ba" --merge-output-format mp4 URL

明確指定 1080p+MP4

yt-dlp -f "bv*[height<=1080]+ba" --merge-output-format mp4 URL

顯示可用畫質清單(先看再選)

yt-dlp -F URL

加入縮圖、Metadata

yt-dlp -f "bv*+ba" --embed-metadata --embed-thumbnail --merge-output-format mp4 URL

更多指令說明請參考請參閱Github

自訂網頁

這麼多指令不是很好記,為了使用方便,請Chtgpt產生了網頁版,方便使用。
將下列內容存成index.html

<!DOCTYPE html>
<html lang="zh-Hant">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>yt-dlp 影音下載指令產生器|支援 8K</title>
<style>
  *,*::before,*::after{box-sizing:border-box}
  body{margin:0;padding:24px 14px;background:#f3f5f8;color:#e9edf1;font-family:system-ui,-apple-system,"Microsoft JhengHei",sans-serif}
  .ytdlp-tool{max-width:720px;margin:24px auto;background:#252a2f;border:1px solid #3a3f45;border-radius:9px;overflow:hidden;box-shadow:0 12px 32px #0002}
  .ytdlp-tool header{padding:18px 22px;background:#20252a;border-bottom:1px solid #3a3f45}
  .ytdlp-tool h1{margin:0;font-size:21px;color:#fff}
  .ytdlp-tool .subtitle{margin:8px 0 0;color:#b8c0c8;font-size:13px;line-height:1.6}
  .ytdlp-tool .section{padding:19px 22px;border-bottom:1px solid #3a3f45}
  .ytdlp-tool .section:last-child{border-bottom:0}
  .ytdlp-tool label{display:block;margin-bottom:9px;color:#fff;font-size:14px;font-weight:700}
  .ytdlp-tool input,.ytdlp-tool select,.ytdlp-tool textarea{display:block;width:100%;max-width:100%;border:1px solid #505963;border-radius:5px;background:#1b2026;color:#f1f5f9;padding:12px;font-size:14px;line-height:1.5}
  .ytdlp-tool textarea{min-height:132px;resize:vertical;background:#0d1117;font-family:Consolas,"Courier New",monospace;overflow-wrap:anywhere}
  .ytdlp-tool input:focus,.ytdlp-tool select:focus,.ytdlp-tool textarea:focus{outline:2px solid #76a8fa;outline-offset:1px}
  .ytdlp-tool .checkline{display:flex;align-items:flex-start;gap:12px;cursor:pointer}.ytdlp-tool .checkline input{width:18px;height:18px;flex:0 0 18px;margin:2px 0 0;accent-color:#2877d4}.ytdlp-tool .checkline span{font-size:14px;line-height:1.5}.ytdlp-tool .hint{margin:8px 0 0;color:#bdc6cf;font-size:12px;line-height:1.7}
  .ytdlp-tool .actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
  .ytdlp-tool button{border:1px solid #56616d;border-radius:5px;padding:11px 16px;background:#364150;color:#fff;font-weight:700;cursor:pointer}
  .ytdlp-tool button.primary{background:#2877d4;border-color:#2877d4}
  .ytdlp-tool button:hover{filter:brightness(1.13)}
  .ytdlp-tool .status{min-height:20px;margin-top:8px;font-size:12px;color:#80e5a0}
  .ytdlp-tool [hidden]{display:none!important}
  @media(max-width:520px){body{padding:8px}.ytdlp-tool{margin:12px auto}.ytdlp-tool .section,.ytdlp-tool header{padding:16px}.ytdlp-tool button{flex:1 1 100%}}
</style>
</head>
<body>
<main class="ytdlp-tool" id="ytdlp-tool">
  <header>
    <h1>yt-dlp 影音下載指令產生器</h1>
    <p class="subtitle">支援 MP3、MP4、最高 8K(4320p)畫質及下載穩定模式。此工具只產生指令,不會在網站伺服器下載影片。</p>
  </header>
  <div class="section">
    <label for="video-url">影音網址</label>
    <input id="video-url" type="url" placeholder="https://www.youtube.com/watch?v=..." autocomplete="off" spellcheck="false">
  </div>
  <div class="section">
    <label for="output-format">輸出格式</label>
    <select id="output-format"><option value="mp4">MP4(影片+音訊)</option><option value="mp3">MP3(僅音訊)</option></select>
  </div>
  <div class="section" id="resolution-section">
    <label for="resolution">影片畫質</label>
    <select id="resolution">
      <option value="best">最高畫質(自動選擇)</option>
      <option value="4320">4320p(8K)</option>
      <option value="2160">2160p(4K)</option>
      <option value="1440">1440p(1440p)</option>
      <option value="1080">1080p(Full HD)</option>
      <option value="720">720p(HD)</option>
      <option value="480">480p(SD)</option>
    </select>
    <p class="hint">所選解析度為最高上限。若來源未提供該畫質,會嘗試下載較低的可用畫質。</p>
  </div>
  <div class="section">
    <label class="checkline" for="stable-mode"><input id="stable-mode" type="checkbox" checked><span>下載穩定模式(建議開啟)</span></label>
    <p class="hint">自動加入 HTTP 分塊 1M、重試 20 次、分段重試 20 次、HTTP 重試等待 5 秒及續傳設定。適用於 8K 大型影片及一般影音下載;實際效果依來源與網路狀況而異。</p>
  </div>
  <div class="section">
    <label for="download-command">下載指令(Windows CMD / PowerShell)</label>
    <textarea id="download-command" readonly aria-label="產生的下載指令"></textarea>
    <div class="actions"><button type="button" class="primary" id="copy-download">複製下載指令</button><button type="button" id="copy-formats">複製畫質查詢指令(-F)</button></div>
    <div class="status" id="status" role="status" aria-live="polite"></div>
    <p class="hint">請先在 Windows 安裝 yt-dlp、FFmpeg 與 Deno,並確認可以在終端機執行。部分 8K 影片使用 AV1 / VP9 編碼;MP4 容器不代表一定是 H.264。</p>
  </div>
</main>
<script>
(function(){
  'use strict';
  const root=document.getElementById('ytdlp-tool');
  const url=root.querySelector('#video-url');
  const format=root.querySelector('#output-format');
  const resolution=root.querySelector('#resolution');
  const resolutionSection=root.querySelector('#resolution-section');
  const output=root.querySelector('#download-command');
  const stableMode=root.querySelector('#stable-mode');
  const status=root.querySelector('#status');
  let timer;
  function quoteForWindows(value){
    // Reject characters that can break or inject commands in CMD / PowerShell.
    // YouTube and other supported HTTPS URLs can be pasted directly.
    return '"'+value.replace(/"/g,'')+'"';
  }
  function normalizedUrl(){
    const value=url.value.trim();
    if(!value)return '';
    try{
      const parsed=new URL(value);
      if(!['https:','http:'].includes(parsed.protocol))return '';
      return parsed.href;
    }catch(_){return '';}
  }
  function update(){
    resolutionSection.hidden=format.value==='mp3';
    const videoUrl=normalizedUrl();
    const suffix=videoUrl?' '+quoteForWindows(videoUrl):' "影片URL"';
    const stability=stableMode.checked?' --http-chunk-size 1M --retries 20 --fragment-retries 20 --retry-sleep http:5 --continue':'';
    if(format.value==='mp3'){
      output.value='yt-dlp --js-runtimes deno -f "ba/b" -x --audio-format mp3'+stability+' --embed-metadata --embed-thumbnail'+suffix;
    }else{
      const r=resolution.value;
      const selector=r==='best'?'bv*+ba/b':'bv*[height<='+r+']+ba/b[height<='+r+']';
      output.value='yt-dlp --js-runtimes deno -f "'+selector+'" --merge-output-format mp4'+stability+' --embed-metadata --embed-thumbnail'+suffix;
    }
    status.textContent=url.value.trim()&&!videoUrl?'請輸入有效的 http:// 或 https:// 影片網址。':'';
  }
  async function copy(text){
    if(!normalizedUrl()){
      status.textContent='請先輸入有效的影片網址,再複製指令。';
      url.focus();return;
    }
    try{
      if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(text);}
      else{
        const temp=document.createElement('textarea');temp.value=text;temp.style.position='fixed';temp.style.opacity='0';document.body.appendChild(temp);temp.select();
        const success=document.execCommand('copy');temp.remove();if(!success)throw new Error('copy failed');
      }
      status.textContent='指令已複製到剪貼簿。';
    }catch(_){
      output.focus();output.select();status.textContent='無法自動複製,請選取指令後按 Ctrl+C。';
    }
    clearTimeout(timer);timer=setTimeout(()=>{status.textContent='';},3500);
  }
  root.querySelector('#copy-download').addEventListener('click',()=>copy(output.value));
  root.querySelector('#copy-formats').addEventListener('click',()=>copy('yt-dlp --js-runtimes deno -F '+quoteForWindows(normalizedUrl())));
  url.addEventListener('input',update);
  format.addEventListener('change',update);
  resolution.addEventListener('change',update);
  stableMode.addEventListener('change',update);
  update();
})();
</script>
</body>
</html>

點選index.html的畫面如下

115 0320 11

在Youtube找到喜歡的影音連結,貼到URL,依據輸出格式與影片畫質產生相對應的指令。
將其複製到對應的目錄,就可以直接下載。

不想記 yt-dlp 指令?試試線上指令產生器

如果沒地方使用自己訂的html或如果不熟悉 yt-dlp 的各種參數,可以使用Moment Story網站上的yt-dlp 線上指令產生器使用

只需輸入影音網址、選擇輸出格式與影片解析度,就可以自動產生對應的 yt-dlp 指令,複製後即可在 Windows CMD 或 PowerShell 執行。

開啟 yt-dlp 線上指令產生器

工具免費使用,不需要註冊帳號。請先在本機安裝 yt-dlp 與 FFmpeg,並確認對下載內容具有適當使用權限。

⬇️為下載的畫面

115 0320 10

支援的網站

依據yt-dlp說明thousands of sites支援數千網站,常見的網站都有支援。
常見的主流社群媒體都有支援

facebook
facebook:ads
facebook:reel
FacebookPluginsVideo
Instagram
instagram:story
instagram:tag: Instagram hashtag search URLs
instagram:user: Instagram user profile (Currently broken)
InstagramIOS: IOS instagram:// URL
youtube: youtube YouTube
youtube:clip: youtube
youtube:favorites: youtube YouTube liked videos; ":ytfav" keyword (requires cookies)
youtube:history: youtube Youtube watch history; ":ythis" keyword (requires cookies)
youtube:​music:search_url: youtube YouTube music search URLs with selectable sections, e.g. #songs
youtube:notif: youtube YouTube notifications; ":ytnotif" keyword (requires cookies)
youtube:playlist: youtube YouTube playlists
youtube:recommended: youtube YouTube recommended videos; ":ytrec" keyword
youtube:search: youtube YouTube search; "ytsearch:" prefix
youtube:search_url: youtube YouTube search URLs with sorting and filter support
youtube:​shorts:pivot:audio: youtube YouTube Shorts audio pivot (Shorts using audio of a given video)
youtube:subscriptions: youtube YouTube subscriptions feed; ":ytsubs" keyword (requires cookies)
youtube:tab: youtube YouTube Tabs
youtube:user: youtube YouTube user videos; "ytuser:" prefix
youtube:watchlater: youtube Youtube watch later list; ":ytwatchlater" keyword (requires cookies)
YoutubeLivestreamEmbed: youtube YouTube livestream embeds
YoutubeYtBe: youtube youtu.be

透過上述的index.html,實測facebook、Instagram都能正常下載。
有興趣的夥伴可以多加利用。

yt-dlp 常見錯誤排除

問題 1:’yt-dlp’ is not recognized

可能原因:

  • 尚未將 yt-dlp.exe 放入 PATH。
  • PATH 修改後沒有重新開啟終端機。
  • 檔案名稱或安裝路徑錯誤。

可以使用:

where.exe yt-dlp

確認 Windows 目前會執行哪個檔案。

問題 2:ffmpeg not found

代表系統無法找到 FFmpeg,可能導致影音合併或 MP3 轉換失敗。

請確認 ffmpeg.exe 與 ffprobe.exe 已放在正確位置,或已將 FFmpeg 所在目錄加入 PATH。

問題 3:Requested format is not available

代表要求的格式條件沒有符合的可用串流。

先執行:

yt-dlp -F "VIDEO_URL"

檢查來源實際提供的解析度、影片與音訊格式,再重新選擇。

問題 4:下載完成但影片沒有聲音

可能是只下載了沒有音訊的影片串流,或音訊未成功合併。

先確認 FFmpeg 可以正常執行,再使用包含影片與音訊選擇條件的指令。

問題 5:下載 MP4 後無法播放

MP4 是容器格式,影片內部可能使用不同的編碼格式,例如 H.264、H.265、AV1 等。

部分舊型設備或播放器無法正常解碼特定格式。

建議先使用 yt-dlp -F 檢查來源格式,再依播放設備選擇相容的編碼格式。必要時可以透過 FFmpeg 重新編碼。

問題 6:HTTP 403 或驗證失敗

可能涉及網址權限、影音網站的存取政策、地區限制、驗證狀態或 yt-dlp 版本相容性。

先確認影片是否可以透過正常瀏覽器存取,以及 yt-dlp 是否為近期版本。

若內容需要登入、會員資格或授權,應使用具有合法存取權限的帳號,不應嘗試繞過平台的存取限制。

FAQ 常見問題

Q1:yt-dlp 是免費軟體嗎?

是。yt-dlp 是開源工具,可從官方 GitHub 取得。

Q2:yt-dlp 一定需要安裝 Python 嗎?

不一定。Windows 使用官方提供的獨立執行檔時,一般不需要另外安裝 Python。

Q3:yt-dlp 可以下載 8K 嗎?

如果來源提供可取得的 8K 格式,yt-dlp 可以選擇相應影音串流;但並不是每支影片都有 8K。

Q4:yt-dlp 一定要 FFmpeg 嗎?

下載某些單一影音格式時可能不需要,但合併分離的影片與音訊、轉換 MP3、部分字幕與 Metadata 後製功能通常需要 FFmpeg。

Q5:能不能直接使用圖形化介面?

可以。Moment Story 另外提供 yt-dlp 線上指令產生器,讓使用者選擇影片格式、解析度後產生下載指令。

線上工具本身主要負責產生指令,實際下載仍需在已安裝 yt-dlp 的電腦上執行。

官方參考資料

延伸閱讀

2,121 Views