Youtrube-dl的替代方案 - yt-dlp

wade3c

Jain Wun

Posted on June 11, 2022

Youtrube-dl的替代方案 - yt-dlp

僅作為示範用,請不要用不法營利上

在一開始yt-dl被下架時出現的fork方案,現在部分功能比yt-dl還完善

Install

Windows

compile好的執行檔可以直接去Github release載

PhantomJS

Download PhantomJS

為了讓yt-dlp能用到PhantomJS,有兩種設定可以選

  • 在system path內做設定 (把phantomjs的bin資料夾加到path內)
  • 把PhantomJS的執行檔移到和yt-dlp的執行檔同一層

Linux

Linux比較建議裝python版的

Python

python3 -m pip install -U yt-dlp
Enter fullscreen mode Exit fullscreen mode

Usage

Windows

.\yt-dlp.exe [OPTIONS] URL
Enter fullscreen mode Exit fullscreen mode

Linux

yt-dlp [OPTIONS] URL
Enter fullscreen mode Exit fullscreen mode

Options

上面提的Options有以下比較常用到的

Login

有些網頁要登入太麻煩可以直接用瀏覽器現成的cookie

  • > Cookies from browser: Cookies can be automatically extracted from all major web browsers using --cookies-from-browser BROWSER[+KEYRING][:PROFILE]

Know Issue

iq.com

如果影片是被限定前幾周只有會員能看的話,會完全解析不了該網頁

但只要超過了VIP限制的時間範圍該影片就會正常

目前Github上有開相關issue,貌似是iq.com自身的問題


Reference

GitHub - yt-dlp/yt-dlp: A youtube-dl fork with additional features and fixes

[yt-dlp] how I use cookies from browser

💖 💪 🙅 🚩
wade3c
Jain Wun

Posted on June 11, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024