From 97c5746b4d214cb02f05461789c63a6ab70c6696 Mon Sep 17 00:00:00 2001 From: Ziad Arafat Date: Wed, 25 Nov 2026 16:17:41 -0700 Subject: [PATCH] Install Deno so yt-dlp can extract YouTube MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit yt-dlp warns that extraction without a JavaScript runtime is deprecated and some formats are missing; Deno is its default runtime for that work. 🤖 Generated with Codebuff Co-Authored-By: Codebuff --- containers/red/Containerfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/containers/red/Containerfile b/containers/red/Containerfile index 57951b7..14a55ee 100644 --- a/containers/red/Containerfile +++ b/containers/red/Containerfile @@ -11,8 +11,11 @@ FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim ARG IMAGEMAGICK_VERSION="8:6.9.11.60+dfsg-1.6+deb12u*" ARG DEJAVU_VERSION="2.37-6" ARG NOTO_EMOJI_VERSION="2.042-0+deb12u*" -# watch's YouTube fallback extracts audio with yt-dlp, which needs ffmpeg. +# watch's YouTube fallback extracts audio with yt-dlp, which needs ffmpeg and +# a JavaScript runtime for YouTube's signature/EJS work. Deno is yt-dlp's +# default runtime. ARG FFMPEG_VERSION="7:5.1.*" +ARG DENO_VERSION="2.9.8" # deb.debian.org is Fastly, which the home network reaches through a congested # path (NMSU -> CENIC -> Fastly: ~125 ms and ~60 KB/s, 2026-11-10) while other # mirrors give 3-7 MB/s. Leaseweb has no debian-security; OCF Berkeley does. @@ -53,6 +56,15 @@ RUN --mount=type=cache,target=/root/.cache/uv \ RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --python /app/.venv/bin/python yt-dlp +# The image has no curl/unzip; Python fetches and unpacks the pinned binary. +RUN python3 -c "import urllib.request; urllib.request.urlretrieve(\ + 'https://github.com/denoland/deno/releases/download/v${DENO_VERSION}/deno-x86_64-unknown-linux-gnu.zip', \ + '/tmp/deno.zip')" \ + && python3 -c "import zipfile; zipfile.ZipFile('/tmp/deno.zip').extract('deno', '/usr/local/bin')" \ + && chmod 755 /usr/local/bin/deno \ + && rm /tmp/deno.zip \ + && deno --version + # Import dogebot.logfilter at interpreter startup, before Red sets up logging RUN echo "import dogebot.logfilter" \ > /app/.venv/lib/python3.11/site-packages/zz-dogebot-logfilter.pth