From c5c0f21fbfafaef4fa9fe8c0582dbda3bf90dd19 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Mon, 23 Mar 2026 22:44:44 +0100 Subject: [PATCH] fix: install Node.js and use web client for YouTube n-challenge solving - ios player client doesn't support cookies, switch to web - Node.js is required for yt-dlp to solve YouTube's n-challenge; without it only image formats are served --- Dockerfile | 1 + app/downloader.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1b52839..1a80e90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM python:3.11-slim RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg \ curl \ + nodejs \ && rm -rf /var/lib/apt/lists/* WORKDIR /app diff --git a/app/downloader.py b/app/downloader.py index 38a3a0b..3185dda 100644 --- a/app/downloader.py +++ b/app/downloader.py @@ -47,7 +47,7 @@ async def extract_audio(url: str) -> Path: "--audio-format", "mp3", "--audio-quality", "128K", "--format", "bestaudio/best/b", - "--extractor-args", "youtube:player_client=ios,web", + "--extractor-args", "youtube:player_client=web", "--output", outtmpl, ]