Fix YouTube downloads failing with 403 by updating Python and adding Deno
yt-dlp deprecated Python 3.10, which is what the Ubuntu 22.04 base image ships, and now requires a JavaScript runtime to solve YouTube's player challenges. Without one, extraction falls back to the android_vr client and every YouTube download fails with "HTTP Error 403: Forbidden". - Move the base image to Ubuntu 24.04 (Python 3.12) - Fetch Deno in the utils stage and ship it in the final image - Replace the pip install of pycryptodomex with python3-pycryptodome, which drops the build-essential install/purge dance entirely - Remove the default "ubuntu" user of 24.04, which occupies UID/GID 1000 - Bump libicu70 to libicu74 for TwitchDownloaderCLI - Document the Python and JavaScript runtime requirements Deno does not publish armv7 binaries, so the fetch script skips that architecture and the image is built without a JS runtime there, same as before. Fixes #1168pull/1169/head
parent
28234c0d4b
commit
478780ddfb
@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
|
||||
# yt-dlp requires a JavaScript runtime to solve YouTube's player challenges.
|
||||
# Without one, YouTube downloads fail with "HTTP Error 403: Forbidden".
|
||||
# See: https://github.com/yt-dlp/yt-dlp/wiki/EJS
|
||||
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
ARCH=x86_64-unknown-linux-gnu;;
|
||||
aarch64)
|
||||
ARCH=aarch64-unknown-linux-gnu;;
|
||||
*)
|
||||
echo "(INFO) Deno is not available for $(uname -m), skipping JavaScript runtime installation."
|
||||
echo "(INFO) YouTube downloads may be limited on this architecture."
|
||||
exit 0
|
||||
esac
|
||||
|
||||
echo "(INFO) Architecture detected: $ARCH"
|
||||
echo "(1/5) READY - Install temp dependencies in deno obtain layer"
|
||||
apt-get update && apt-get -y install curl unzip ca-certificates
|
||||
echo "(2/5) DOWNLOAD - Acquire latest deno release"
|
||||
curl -o deno.zip \
|
||||
--connect-timeout 5 \
|
||||
--max-time 120 \
|
||||
--retry 5 \
|
||||
--retry-delay 0 \
|
||||
--retry-max-time 40 \
|
||||
-L "https://github.com/denoland/deno/releases/latest/download/deno-${ARCH}.zip"
|
||||
echo "(3/5) PROVISION - Provide deno from deno obtain layer"
|
||||
unzip -o deno.zip -d /usr/local/bin
|
||||
chmod +x /usr/local/bin/deno
|
||||
echo "(4/5) Smoke test"
|
||||
/usr/local/bin/deno --version
|
||||
echo "(5/5) CLEANUP - Remove temporary downloads from deno obtain layer"
|
||||
rm -f deno.zip
|
||||
apt-get -y remove curl unzip
|
||||
apt-get -y autoremove
|
||||
Loading…
Reference in New Issue