The yt-dlp package provides a Python3 CLI utility to download audio and video files from thousands of websites, including YouTube. It can convert downloads into other formats using FFmpeg.
cURL, FFmpeg, make-ca, and Node.js
brotli (with Python3 bindings), certifi, Requests, and Urllib3
Install yt-dlp by running the following commands:
pip3 wheel -w dist --no-build-isolation --no-deps --no-cache-dir $PWD
Now, as the root user:
pip3 install --no-index --find-links=dist --no-cache-dir --no-user yt_dlp
YouTube has made it so JavaScript challenges need to be done in
order to pull from its site. If you download YouTube videos using
this package, download a JavaScript runtime/engine like Node.js.
The following instructions assume you have it installed. Next,
create a system configuration file, telling yt-dlp to use Node.js
for JS challenges and automatically download the challenge scripts
required, as the root user:
cat > /etc/yt-dlp.conf << EOF
--js-runtimes node --remote-components ejs:github
EOF
Now yt-dlp will use Node.js to solve JS challenges when downloading YouTube videos, automatically downloading scripts by yt-dlp to do so.