From 3e439f2d3a1eca661ca92532713ef8ebed1f116b Mon Sep 17 00:00:00 2001 From: Mattias Tall Date: Tue, 26 May 2026 09:57:02 +0200 Subject: [PATCH] Add Node.js to Docker image; use web player client only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Node.js is required by yt-dlp to solve YouTube's n-challenge (format URL deobfuscation). Without it the web client returns no video formats. The tv and ios player clients were removed — both require GVS PO tokens that we don't have, so they only produce warnings and block every request. The web client with Node.js installed gives 30+ formats and works cleanly. Co-Authored-By: Claude Sonnet 4.6 --- backend/Dockerfile | 2 +- backend/services/ytdlp.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 5a86fa2..71b9cf0 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.12-slim 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 nodejs && rm -rf /var/lib/apt/lists/* 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 diff --git a/backend/services/ytdlp.py b/backend/services/ytdlp.py index ffd8e79..7063997 100644 --- a/backend/services/ytdlp.py +++ b/backend/services/ytdlp.py @@ -216,7 +216,7 @@ def fetch_video_metadata(video_id: str) -> dict | None: base_cmd = [ "yt-dlp", url, "--dump-json", "--no-download", "--no-playlist", - "--extractor-args", "youtube:player_client=tv,ios,web", + "--extractor-args", "youtube:player_client=web", ] stdout, stderr, code = _run([*base_cmd, *cookie_args], timeout=30) if code != 0: @@ -567,7 +567,7 @@ def start_download( "--no-part", "--no-mtime", "-o", output_template, "--newline", "--progress", "--no-colors", - "--extractor-args", "youtube:player_client=tv,ios,web", + "--extractor-args", "youtube:player_client=web", *_cookie_args(), ], stdout=subprocess.PIPE,