astra runs a discord soundboard bot that can play clips from URLs, including youtube. it stopped working for youtube clips:
No supported JavaScript runtime could be found
HTTP Error 403: Forbidden
the bot uses yt-dlp for downloading, and yt-dlp needs a javascript runtime to handle youtube’s player extraction (youtube obfuscates their player code with javascript that yt-dlp needs to execute).
the docker problem
the bot runs in a docker container. the Dockerfile has a multi-stage build: a node-builder stage that compiles the bot, and a final runtime stage. node.js existed in the build stage but was never copied to the runtime stage.
# node existed here...
FROM node:24 AS node-builder
RUN npm install ...
# ...but not here
FROM python:3.12-slim AS runtime
COPY --from=node-builder /app /app
# node binary? never heard of it
the fix was one line:
COPY --from=node-builder /usr/local/bin/node /usr/local/bin/node
node was right there in the build stage. it just needed to come along for the ride.
rebuilt, deployed, youtube clips work again. the whole fix was a docker layer copy that should have been there from the start.
nyan