直接從您的終端觀看 wcofun.com 的影片。您可以搜尋、串流和下載影片或播放清單。您也可以從上次的情節繼續。
只需下載 wcofun 腳本,安裝下面列出的依賴項並執行它。
wget https://raw.githubusercontent.com/matheusfillipe/wcofun.cli/master/wcofun
chmod +x wcofun
./wcofun
sudo apt install coreutils jq fzf rofi mpv -y
不幸的是,你仍然需要 htmlq ,它可以與 Cargo 一起安裝:
cargo install htmlq
或從他們的發布頁面下載並放在您的路徑中:
# Notice this might not be the earliest version!
wget https://github.com/mgdm/htmlq/releases/download/v0.4.0/htmlq-x86_64-linux.tar.gz
tar -xvzf htmlq-x86_64-linux.tar.gz
sudo cp htmlq /usr/bin/ # or anywhere in your path
您可以從 AUR 安裝:https://aur.archlinux.org/packages/wcofun
yay -S wcofun
或者,如果您下載腳本,您可以透過以下方式取得依賴項:
yay -S coreutils mpv htmlq jq fzf rofi # htmlq is on the AUR
為避免「未找到」問題:
yay -S curl-impersonate-chrome
brew install coreutils htmlq jq fzf mpv
./wcofun
或./wocfun search query here
如果您想下載所有劇集: ./wcofun -d Search query here
WCOFUN.CLI
---------------------------------------------------------------------------------
Syntax:
/home/matheus/Projects/wcofun/wcofun [-n] [-s | -D | -d [range]] [search query]
All parameters are optional.
Example:
Search and stream or download one episode: wcofun [search query]
Download all episodes: wcofun -D [search query]
Watch next episode: wcofun -n
Options:
-D: Download all episodes of selected anime.
-d [ep-number|start-end]: Download a range of episodes by specifying the beginning and end. You can also specify a single episode number or a range like n- to download all starting from the nth or -n to download all until the nth. An empty range (-) will cause cause it to prompt for the episode number and then download.
-s: Stream selectped episode
-n: Play next episode of lastly watched anime
-p: Play previous episode of lastly watched anime
-P [command]: Pre execution command. Useful for launching an http proxy.
-e: Edit config with nvim
-c: Edit cached searches with nvim
-h: Show this help
預設情況下,如果沒有可用的終端輸出,它將使用終端中的 fzf 和 rofi。您可以在~/.wcofunrc
中有一個配置文件,您可以在其中導出一些相關變數:
# MENU_CMD: Choose your menu command. Tested with dmenu, fzf and rofi only
# NOTIFY_CMD. How to tell you about the status. Leave empty for a simple echo to stdout
export MENU_CMD= " fzf "
export MENU_CMD= " rofi -dmenu -i "
# MENU_CMD="dmenu"
export NOTIFY_CMD= " notify-send WCOFUN "
# User agent. Maybe you have problems so try changing this.
export UA= " User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0 "
# Maybe you want to use a proxy? (Helps when getting blocked by cloudflare, or if you want to debug)
export CURL_EXTRA_PARAMS= " " # this option is not used for stream and download
# CURL_EXTRA_PARAMS="-k --tlsv1 -x http://localhost:8080"
export PRE_COMMAND= " "
# PRE_COMMAND="mitmdump 2>&1 /dev/null"
如果您沒有得到所有結果,您可能被 cloudflare 阻止了。出現這個問題是因為curl的tls握手與瀏覽器的握手不一樣。以下是一些解決方案:
安裝像mitmproxy
這樣的代理: pacman -S mitmproxy
或brew install mitmproxy
並建立一個配置,例如:
export CURL_EXTRA_PARAMS= " -k --tlsv1 -x http://localhost:8080 "
export PRE_COMMAND= " mitmdump 2>&1 /dev/null "
這將在 wcofun 搜尋開始之前在本地啟動代理。
如果您使用的是 Linux,我發現這是由於 cloudflare 以某種方式檢測到較新版本的 openssl 所致。您可以從 ubuntu 機器或從此處取得 ubuntu 20.04 libssl.so.1.1
。從中提取庫,然後啟動 wcofun 並相應地設定LD_LIBRARY_PATH
。
mkdir libssl
cd libssl
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
ar xar x libssl1.1_1.1.1f-1ubuntu2_amd64.deb
tar xf data.tar.xz
mkdir -p ~ /curlibs
cp usr/lib/x86_64-linux-gnu/libssl.so.1.1 ~ /curlibs
cd ..
rm -r libssl
# And finally run it like:
LD_LIBRARY_PATH= ~ /curlibs wcofun
或者您可以將export LD_LIBRARY_PATH=~/curlibs
加入到~/.wcofunrc
。
按照自述文件中的描述建立此項目,選擇 Firefox 或 chrome,將建構的 curl 執行檔複製到系統上的某個位置並將CURL_PATH
設定為它。
git clone --depth=1 https://github.com/lwthiker/curl-impersonate
cd curl-impersonate
docker build -t curl-impersonate-chrome chrome/
# Wait for a while and let's check it out
docker run -it curl-impersonate-chrome /bin/bash
ls /build/out
如果您看到curl-impersonate curl_chrome98
則表示它有效。暫時不要關閉容器外殼。
ROM 另一種終端類型:
docker cp curl-impersonate-chrome:/build/out/curl-impersonate /some/important/path/curl-impersonate
現在只要設定在~/.wcofunrc
上CURL_PATH="/some/important/path/curl-impersonate"
在 arch linux 上,你可以使用以下指令輕鬆安裝它:
yay -S curl-impersonate-bin
並在~/.wcofunrc
上設定CURL_PATH="/usr/local/bin/curl-impersonate-chrome"