From 1ba136b91cb3c25f0e83abcbc133a66338dc5c37 Mon Sep 17 00:00:00 2001 From: Diane Date: Thu, 3 Sep 2026 13:31:00 +0000 Subject: [PATCH 1/2] Fix radio downloads: ship EJS solver scripts and allow runtime refresh yt-dlp now solves YouTube JS challenges via external EJS scripts (yt-dlp-ejs package); a bare PyPI yt-dlp does not include them and remote fetching is disabled by default. Images built after the EJS migration therefore fail every download with HTTP 403 while playlists keep working. Use yt-dlp[default] so the matching yt-dlp-ejs ships in the image, and pass --remote-components ejs:github so solver scripts refresh at runtime when YouTube rotates challenges. --- main.py | 4 ++++ requirements.txt | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 8008814..603f158 100755 --- a/main.py +++ b/main.py @@ -486,6 +486,10 @@ async def process_radio_track(video_link, video_id, title): "jpg", "--js-runtimes", "quickjs", + # Refresh EJS challenge-solver scripts from GitHub at runtime so a + # stale image doesn't break downloads when YouTube rotates challenges. + "--remote-components", + "ejs:github", "--output", f"{base_filepath}.%(ext)s", video_link, diff --git a/requirements.txt b/requirements.txt index 318271b..fe3ed23 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,7 @@ matrix-nio == 0.24.0 google-auth-oauthlib == 1.3.1 google-api-python-client == 2.194.0 -yt-dlp +# The "default" extra pulls in yt-dlp-ejs, the JS challenge solver scripts +# YouTube requires for downloads. Keep it in lockstep with yt-dlp. +yt-dlp[default] mutagen -- 2.54.0 From bd6f862c0c22069b92a0510b8737d69dd4091faa Mon Sep 17 00:00:00 2001 From: Diane Date: Thu, 3 Sep 2026 13:38:32 +0000 Subject: [PATCH 2/2] Drop explanatory comments --- main.py | 2 -- requirements.txt | 2 -- 2 files changed, 4 deletions(-) diff --git a/main.py b/main.py index 603f158..05a9a13 100755 --- a/main.py +++ b/main.py @@ -486,8 +486,6 @@ async def process_radio_track(video_link, video_id, title): "jpg", "--js-runtimes", "quickjs", - # Refresh EJS challenge-solver scripts from GitHub at runtime so a - # stale image doesn't break downloads when YouTube rotates challenges. "--remote-components", "ejs:github", "--output", diff --git a/requirements.txt b/requirements.txt index fe3ed23..b4c030f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,5 @@ matrix-nio == 0.24.0 google-auth-oauthlib == 1.3.1 google-api-python-client == 2.194.0 -# The "default" extra pulls in yt-dlp-ejs, the JS challenge solver scripts -# YouTube requires for downloads. Keep it in lockstep with yt-dlp. yt-dlp[default] mutagen -- 2.54.0