[研究] yt-dlp 2025.12.08 安裝與下載 Youtube 影片
2026-01-27
安裝環境 : Windnows Server 2019
yt-dlp 2025.12.08 下載
https://github.com/yt-dlp/yt-dlp/releases/
下載 yt-dlp_win.zip
解壓縮即可用
C:\yt-dlp>cd yt-dlp_win C:\yt-dlp\yt-dlp_win>yt-dlp.exe Usage: yt-dlp.exe [OPTIONS] URL [URL...] yt-dlp.exe: error: You must provide at least one URL. Type yt-dlp --help to see a list of all options. C:\yt-dlp\yt-dlp_win>yt-dlp.exe --version 2025.12.08 C:\yt-dlp\yt-dlp_win> |
下圖,
下圖, 下圖,下圖,
下圖,
下載
C:\yt-dlp\yt-dlp_win>yt-dlp.exe --cookies "cookies.txt" "https://www.youtube.com/watch?v=-(略)" ERROR: Cookies file must be Netscape formatted, not JSON. See https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp ERROR: Cookies file must be Netscape formatted, not JSON. See https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp C:\yt-dlp\yt-dlp_win> |
yt-dlp 不接受 JSON 格式的 cookies,必須是 Netscape 格式(傳統 cookies.txt 格式)。你現在的 cookies.txt 是 JSON 格式(EditThisCookie V3 預設匯出就是 JSON)。
解決方法:用 EditThisCookie 匯出 Netscape 格式
在 Chrome 工具列點 EditThisCookie 小餅乾圖示 → 打開面板。
點面板右上角 Export 下拉箭頭。
選擇 “Export as Netscape Format”。
這樣匯出的文字就是 yt-dlp 可以用的 cookies.txt。
下圖,
下圖,下圖,
下載
C:\yt-dlp\yt-dlp_win>yt-dlp.exe --cookies "cookies.txt" "https://www.youtube.com/watch?v=-(略)" [youtube] Extracting URL: https://www.youtube.com/watch?v=-(略) [youtube] -(略): Downloading webpage [youtube] -(略): Downloading tv downgraded player API JSON [youtube] -(略): Downloading web safari player API JSON WARNING: [youtube] -(略): n challenge solving failed: Some formats may be missing. Ensure you have a supported JavaScript runtime and challenge solver script distribution installed. Review any warnings presented before this message. For more details, refer to https://github.com/yt-dlp/yt-dlp/wiki/EJS [youtube] -(略): Downloading m3u8 information [info] Testing format 96 [download] Got error: HTTP Error 403: Forbidden ERROR: fragment 1 not found, unable to continue WARNING: Unable to download format 96. Skipping... [info] Testing format 95 [download] Got error: HTTP Error 403: Forbidden ERROR: fragment 1 not found, unable to continue WARNING: Unable to download format 95. Skipping... [info] Testing format 93 [download] Got error: HTTP Error 403: Forbidden ERROR: fragment 1 not found, unable to continue WARNING: Unable to download format 93. Skipping... [info] Testing format 91 [download] Got error: HTTP Error 403: Forbidden ERROR: fragment 1 not found, unable to continue WARNING: Unable to download format 91. Skipping... ERROR: [youtube] -(略): Requested format is not available. Use --list-formats for a list of available formats C:\yt-dlp\yt-dlp_win> |
工具並非萬能,這部影片看來無法下載。
改測試一個公開瀏覽的
C:\yt-dlp\yt-dlp_win>yt-dlp.exe "https://www.youtube.com/watch?v=(略)" [youtube] Extracting URL: https://www.youtube.com/watch?v=(略) [youtube] (略): Downloading webpage WARNING: [youtube] No supported JavaScript runtime could be found. Only deno is enabled by default; to use another runtime add --js-runtimes RUNTIME[:PATH] to your command/config. YouTube extraction without a JS runtime has been deprecated, and some formats may be missing. See https://github.com/yt-dlp/yt-dlp/wiki/EJS for details on installing one [youtube] (略): Downloading android sdkless player API JSON [youtube] (略): Downloading web safari player API JSON WARNING: [youtube] (略): Some web_safari client https formats have been skipped as they are missing a url. YouTube is forcing SABR streaming for this client. See https://github.com/yt-dlp/yt-dlp/issues/12482 for more details [youtube] (略): Downloading m3u8 information WARNING: [youtube] (略): Some web client https formats have been skipped as they are missing a url. YouTube is forcing SABR streaming for this client. See https://github.com/yt-dlp/yt-dlp/issues/12482 for more details WARNING: ffmpeg not found. The downloaded format may not be the best available. Installing ffmpeg is strongly recommended: https://github.com/yt-dlp/yt-dlp#dependencies [info] (略): Downloading 1 format(s): 95 [hlsnative] Downloading m3u8 manifest [hlsnative] Total fragments: 57 [download] Destination: 練習(6) [(略)].mp4 [download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (1/10)... [download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (2/10)... [download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (3/10)... [download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (4/10)... [download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (5/10)... [download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (6/10)... [download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (7/10)... [download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (8/10)... [download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (9/10)... [download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (10/10)... [download] fragment not found; Skipping fragment 1 ... ...(略) |
還是不行???
(完)
沒有留言:
張貼留言