Fix EJS: install yt-dlp[default] and enable --js-runtimes node
yt-dlp's EJS (External JavaScript Solver) needs two things: 1. The solver scripts — only bundled with yt-dlp[default], not bare yt-dlp 2. An explicit --js-runtimes flag — Node.js is not the default (Deno is) Both are now set: pip installs the [default] extras, and /etc/yt-dlp.conf sets --js-runtimes node globally so every yt-dlp call uses it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,15 +5,15 @@ WORKDIR /app
|
|||||||
RUN apt-get update && apt-get install -y ffmpeg gosu && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y ffmpeg gosu && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY backend/requirements.txt ./backend/requirements.txt
|
COPY backend/requirements.txt ./backend/requirements.txt
|
||||||
RUN pip install --no-cache-dir -r backend/requirements.txt && pip install --no-cache-dir -U yt-dlp
|
# yt-dlp[default] includes the EJS challenge solver scripts required by YouTube.
|
||||||
|
# nodeenv installs Node.js (v22+ required); --js-runtimes node tells yt-dlp to use it.
|
||||||
# nodeenv downloads a pre-built Node.js binary via pip — no apt repos needed.
|
RUN pip install --no-cache-dir -r backend/requirements.txt && \
|
||||||
# yt-dlp needs 'node' in PATH to solve YouTube's n-challenge (JS obfuscation).
|
pip install --no-cache-dir -U "yt-dlp[default]" && \
|
||||||
RUN pip install --no-cache-dir nodeenv && \
|
pip install --no-cache-dir nodeenv && \
|
||||||
nodeenv --prebuilt /opt/node && \
|
nodeenv --prebuilt /opt/node && \
|
||||||
ln -sf /opt/node/bin/node /usr/local/bin/node
|
ln -sf /opt/node/bin/node /usr/local/bin/node
|
||||||
|
|
||||||
RUN echo "--cache-dir /data/yt-dlp-cache" > /etc/yt-dlp.conf
|
RUN printf -- '--cache-dir /data/yt-dlp-cache\n--js-runtimes node\n' > /etc/yt-dlp.conf
|
||||||
|
|
||||||
COPY backend/ ./backend/
|
COPY backend/ ./backend/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user