Fix YouTube downloads: bump yt-dlp, require Node 22, drop YT cookies

Two YouTube regressions stacked up:

- yt-dlp 2026.3.17 hit "HTTP Error 403: Forbidden" on the actual media
  download. Bumping to 2026.6.9 fixes the data-download 403, but its EJS
  n-sig challenge solver now requires Node >= 22, and Debian 13 only ships
  Node 20 ("node-20.x (unsupported)" -> only image formats resolve). bot.py
  now points --js-runtimes at a standalone /opt/node22 via the new
  JS_RUNTIME constant.

- With a cookies.txt present, yt-dlp skips the cookieless android_vr/android
  clients (whose URLs work) and falls back to the `tv` client, whose media
  URLs 403. New _cookie_args(url) withholds cookies for YouTube hosts only,
  while still sending them to Instagram/TikTok/X.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-16 16:12:17 -04:00
parent 76ac4ea57a
commit d16c025753
3 changed files with 40 additions and 10 deletions
+5 -2
View File
@@ -1,6 +1,9 @@
signalbot==1.1.0
# yt-dlp is kept current for site/extractor changes; bump the floor deliberately.
yt-dlp>=2026.3.17
# 2026.6.9 fixes a YouTube 403-on-data-download regression; it also requires the
# JS challenge to run on Node >= 22 (see below).
yt-dlp>=2026.6.9
# Needed for YouTube: yt-dlp wraps URLs in a JS "n-sig" challenge that a JS
# runtime must solve. Requires a system `node` on PATH plus this package.
# runtime must solve. Requires Node >= 22 on PATH (bot.py points at a standalone
# /opt/node22 since Debian 13 only ships Node 20) plus this package.
yt-dlp-ejs>=0.8.0