fix(linux): bundle Node.js 22 LTS for yt-dlp JS challenge solver

yt-dlp's EJS reports any Node.js < 22.0.0 as "(unsupported)" and disables
the node JS challenge provider (jsc/_builtin/node.py:
MIN_SUPPORTED_VERSION = (22, 0, 0)). The previously bundled node was v20,
so the YouTube nsig/signature solver silently degraded ("No supported
JavaScript runtime could be found"), and some videos/formats failed.

Download an official Node 22 LTS binary in linux.sh instead of the v20
asset from ffmpeg-builds. Verified: yt-dlp now reports
"JS runtimes: node-22.22.3" with the node challenge provider available.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pull/435/head
tomasris 1 month ago
parent ff1ecf6f3c
commit 41d825f193

@ -7,11 +7,20 @@ if ! command -V curl > /dev/null 2>&1; then
fi
wget "https://github.com/aandrew-me/ffmpeg-builds/releases/download/v8/ffmpeg_linux_amd64.tar.xz"
wget "https://github.com/aandrew-me/ffmpeg-builds/releases/download/v8/node_linux_amd64" -O node
chmod +x node
tar -xf ffmpeg_linux_amd64.tar.xz
mv ffmpeg_linux_amd64 ffmpeg
chmod +x ffmpeg/bin/ffmpeg
chmod +x ffmpeg/bin/ffprobe
chmod +x ffmpeg/bin/ffplay
# yt-dlp's EJS requires Node.js >= 22 for the JavaScript challenge solver
# (yt_dlp/.../jsc/_builtin/node.py: MIN_SUPPORTED_VERSION = (22, 0, 0)).
# Older bundled node is reported as "(unsupported)" and YouTube nsig
# descrambling silently degrades. Bundle an official Node 22 LTS binary.
NODE_VERSION="v22.22.3"
wget "https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-x64.tar.xz" -O node.tar.xz
tar -xf node.tar.xz
mv "node-${NODE_VERSION}-linux-x64/bin/node" node
chmod +x node
rm -rf "node-${NODE_VERSION}-linux-x64" node.tar.xz

Loading…
Cancel
Save