直接从您的终端观看 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"