From 04fd645966913768139b515421ea540c042299cf Mon Sep 17 00:00:00 2001 From: Pnant <73925474+Panniantong@users.noreply.github.com> Date: Tue, 31 Mar 2026 19:12:44 +0800 Subject: [PATCH] =?UTF-8?q?docs(skill):=20add=20upstream=20caveats=20for?= =?UTF-8?q?=20Reddit,=20B=E7=AB=99,=20YouTube?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on upstream issue investigation: - Reddit (rdt-cli): ensure v0.4.2+, note login-required features - B站: 412 is overseas-IP + no-cookie, add bili-cli commands - YouTube: --write-comments is best-effort, auto-subs may duplicate Co-Authored-By: Claude Opus 4.6 (1M context) --- agent_reach/skill/references/social.md | 4 ++- agent_reach/skill/references/video.md | 35 +++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/agent_reach/skill/references/social.md b/agent_reach/skill/references/social.md index 25009d5..8267320 100644 --- a/agent_reach/skill/references/social.md +++ b/agent_reach/skill/references/social.md @@ -183,4 +183,6 @@ rdt popular --limit 10 rdt all --limit 10 ``` -> **安装**: `pipx install rdt-cli`。无需登录即可搜索和阅读。 +> **安装**: `pipx install rdt-cli`(确保 v0.4.2+)。无需登录即可搜索和阅读。 +> 需要登录的功能:`rdt feed --subs-only`(订阅列表)、`rdt saved`(收藏)。 +> 建议使用 `--yaml` 输出,对 AI agent 更友好。 diff --git a/agent_reach/skill/references/video.md b/agent_reach/skill/references/video.md index c79c71e..7ce12b4 100644 --- a/agent_reach/skill/references/video.md +++ b/agent_reach/skill/references/video.md @@ -20,27 +20,54 @@ yt-dlp --write-sub --write-auto-sub --sub-lang "zh-Hans,zh,en" --skip-download - cat /tmp/VIDEO_ID.*.vtt ``` +### 获取评论 + +```bash +# 提取评论(best-effort,不保证完整) +yt-dlp --write-comments --skip-download --write-info-json \ + --extractor-args "youtube:max_comments=20" \ + -o "/tmp/%(id)s" "URL" +# 评论在 .info.json 的 comments 字段中 +``` + ### 搜索视频 ```bash yt-dlp --dump-json "ytsearch5:query" ``` -## B站 / Bilibili (yt-dlp) +> **字幕注意**: 手动上传的字幕提取可靠;自动生成字幕可能存在行间重复,需后处理。 +> **评论注意**: `--write-comments` 基于网页抓取(非 YouTube Data API),部分评论可能丢失。 -### 获取视频元数据 +## B站 / Bilibili (yt-dlp + bili-cli) + +### 视频元数据 (yt-dlp) ```bash yt-dlp --dump-json "https://www.bilibili.com/video/BVxxx" ``` -### 下载字幕 +### 字幕 (yt-dlp) ```bash yt-dlp --write-sub --write-auto-sub --sub-lang "zh-Hans,zh,en" --convert-subs vtt --skip-download -o "/tmp/%(id)s" "URL" ``` -> **注意**: 服务器 IP 可能遇到 412 错误。使用 `--cookies-from-browser chrome` 或配置代理。 +### 搜索/热门/排行 (bili-cli) + +```bash +# 搜索视频 +bili search "query" --type video -n 5 + +# 热门视频 +bili hot -n 10 + +# 排行榜 +bili rank -n 10 +``` + +> **412 风控**: 海外 IP 必须提供 Cookie(`--cookies-from-browser chrome` 或 `--cookies /path/to/cookies.txt`),国内 IP 一般不受影响。 +> **安装 bili-cli**: `pipx install bilibili-cli`,然后 `bili login` 扫码登录。 ## 小宇宙播客 / Xiaoyuzhou Podcast