fix: YouTube requires JS runtime — auto-configure Node.js in install

yt-dlp now requires an external JS runtime (deno or Node.js) for YouTube.
Since agent-reach already installs Node.js, we configure yt-dlp to use it:

1. cli.py: install writes '--js-runtimes node' to ~/.config/yt-dlp/config
2. youtube.py: doctor checks JS runtime availability and config
3. SKILL.md: updated YouTube section with accurate troubleshooting

Bilibili note: 412 errors are IP-based (needs proxy), not cookie-related.

Fixes #47
This commit is contained in:
Panniantong
2026-02-27 11:45:39 +01:00
parent e620a1db8f
commit 0d1a33236e
3 changed files with 45 additions and 7 deletions
+4 -3
View File
@@ -93,7 +93,8 @@ xreach tweets @username --json -n 20
### YouTube (yt-dlp)
> ⚠️ 服务器 IP 可能触发 YouTube 反爬("Sign in to confirm you're not a bot")。遇到时加 `--cookies-from-browser chrome` 或通过代理
> ⚠️ yt-dlp 需要 JS runtime 才能下载 YouTube。`agent-reach install` 会自动配置 Node.js 作为 runtime
> 如果遇到 "Sign in to confirm you're not a bot",是 IP 被 YouTube 反爬,换代理或加 cookies。
```bash
# Get video metadata
@@ -106,8 +107,8 @@ yt-dlp --write-sub --write-auto-sub --sub-lang "zh-Hans,zh,en" --skip-download -
# Search (yt-dlp ytsearch)
yt-dlp --dump-json "ytsearch5:query"
# If blocked ("Sign in to confirm you're not a bot"):
yt-dlp --cookies-from-browser chrome --dump-json "URL"
# If "no JS runtime" warning: ensure Node.js is installed, then run:
# mkdir -p ~/.config/yt-dlp && echo "--js-runtimes node" >> ~/.config/yt-dlp/config
```
### Bilibili (yt-dlp)