Install Node.js via nodeenv (pip); use web client

nodeenv is a Python package that downloads a pre-built Node.js binary —
no apt repos, no compilation, guaranteed to work in python:3.12-slim.
The 'node' binary is linked into /usr/local/bin so yt-dlp can find it.

With Node.js available the web client works fully (37 formats) and can
solve YouTube's n-challenge that every other approach was failing on.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mattias Tall
2026-05-26 10:16:10 +02:00
parent 53ea64ee8a
commit 050caead54
3 changed files with 10 additions and 3 deletions

View File

@@ -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=web_embedded",
"--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=web_embedded",
"--extractor-args", "youtube:player_client=web",
*cookie_args,
],
stdout=subprocess.PIPE,