alexta69 / metube

Self-hosted YouTube downloader (web UI for youtube-dl / yt-dlp)
GNU Affero General Public License v3.0
6.34k stars 399 forks source link

[Feature request] Add support for curl-cffi #466

Open janusn opened 3 months ago

janusn commented 3 months ago

I have encountered some videos on vimeo require curl-cffi in order to download. Is there a way to include it or an option to bundle it with the image?

PikuZheng commented 3 months ago

The analysis of video sites is done by yt-dlp. I don't think yt-dlp will call it after adding some wheels.

janusn commented 3 months ago

There is a specific Impersonation section on the readme of yt-dlp that mentioned how to integrate curl_cffi as the recommended solution.

Could you please take a look?

PikuZheng commented 3 months ago

Since it is difficult to determine the architecture, I think the easiest way is to inspect the running metube container and install it.

take x86_64 for example:

wget -qO- https://github.com/yifeikong/curl-impersonate/releases/download/v0.7.0/libcurl-impersonate-v0.7.0.x86_64-linux-musl.tar.gz |tar xvz -C /lib
apk add build-base gcc g++ musl-dev
pip install --no-cache-dir curl_cffi==0.5.10

and determine if the installation was successful

yt-dlp --list-impersonate-targets
janusn commented 2 months ago

Thanks for your prompt reply.

Yeah, I am ok to add a little script to install it but it has to be done every time metube is updated.

Is it possible for the container to run scripts in a specific directory every time it starts up? Like what linuxserver.io does?

PikuZheng commented 2 months ago

build with this Dockerfile if you really want :)