Skip to content

You're reading this. The skill predicted it. A workflow that turns every post into a calibrated experiment—score, blind-predict, retro, evolve. The future doesn't reward effort, it rewards those who see the pattern first. 1M followers in a month — not luck, system.

Python

feat(perf-data): add bilibili-stat adapter (#41)

Dwin9bd1cc60d2e5
diff --git a/adapters/perf-data/bilibili-stat/.gitattributes b/adapters/perf-data/bilibili-stat/.gitattributes
new file mode 100644
index 0000000..1bbd695
--- /dev/null
+++ b/adapters/perf-data/bilibili-stat/.gitattributes
@@ -0,0 +1,2 @@
+*.sh text eol=lf
+*.py text eol=lf
diff --git a/adapters/perf-data/bilibili-stat/README.md b/adapters/perf-data/bilibili-stat/README.md
new file mode 100644
index 0000000..5777540
--- /dev/null
+++ b/adapters/perf-data/bilibili-stat/README.md
@@ -0,0 +1,68 @@
+# bilibili-stat — B站 perf-data adapter
+
+回收**自己(或任意)B站视频**的播放数据 + 热门评论,供 `/cheat-retro` 复盘。
+
+被 `/cheat-retro` 调用:当 `state.data_collection=adapter` 且 `Platform: bilibili` 时。
+
+## 为什么它比抖音/小红书 adapter 简单
+
+B站的视频统计(`view`)与评论(`reply`)都是**公开接口**:
+
+- 不需要登录(没有 `crawler.py login` 步骤、不碰 `.auth/`)
+- 不需要 wbi 签名(`view` 接口免签名;评论走 `x/v2/reply` 老接口,按热度 `sort=2`)
+- 不需要浏览器(纯 `httpx`,无 playwright)
+
+所以 **clone 下来装个 `httpx` 就能用**,零配置。
+
+## 安装
+
+```bash
+pip install -r requirements.txt
+```
+
+(若你的内容项目根有 `.venv`,run.sh 会优先用它;否则用系统 `python3`/`python`。)
+
+## 用法
+
+`/cheat-retro` 会自动按下面的契约调用,一般你不用手动跑:
+
+```bash
+bash run.sh <bvid_or_url> <video_folder> [<script_path>]
+```
+
+- `<bvid_or_url>`:`BV1cUoUY9Ecr`,或任意含 BV 号的链接(如 `https://www.bilibili.com/video/BV1cUoUY9Ecr`)
+- `<video_folder>`:输出目录,`report.md` 会写进这里
+- `<script_path>`:可选,原始稿子,会并入 report.md 供复盘 diff
+
+也可直接调底层:
+
+```bash
+python review.py video BV1cUoUY9Ecr # 抓数据 → 写 videos/<auto>/report.md
+python review.py login # B站无需登录,仅打印说明(接口一致性)
+```
+
+## 输出(report.md)
+
+与 douyin-session 同格式,含:
+
+- 视频元信息(标题 / UP主 / 发布时间 / 时长 / 链接)
+- **播放数据**:播放、点赞、投币、收藏、分享、评论、弹幕,并附派生比率(赞播比 / 投币率 / 收藏率 / 分播比)——B站「三连率」尤其能反映硬核认可度
+- 原始稿子(若提供)
+- **热门评论**(按点赞降序,带 IP 属地)
+
+## 接口
+
+| 数据 | 接口 |
+|---|---|
+| 视频统计 | `GET https://api.bilibili.com/x/web-interface/view?bvid=<BV号>` |
+| 评论 | `GET https://api.bilibili.com/x/v2/reply?type=1&oid=<aid>&sort=2&pn=&ps=20` |
+
+`oid` 取自 view 接口返回的 `aid`。评论按热度(`sort=2`)翻页,默认取 top 50。
+
+## 退出码
+
+`0` 成功 · `2` 缺依赖(httpx 未装)· `3` 其他失败(网络 / 解析 / BV 号错误)。任何失败时 `/cheat-retro` 会优雅降级到 manual 模式。
+
+## 字段随接口改版的维护
+
+`view` 的 `stat` 字段名(view/like/coin/favorite/share/reply/danmaku)和评论的 `replies[].{like,content.message,member.uname,rcount,reply_control.location}` 都已按 2026-06 真实返回校准。若 B站改版导致某项为 0,对照 `crawler.py` 的 `fetch_video` / `_normalize_comment` 调整 key 即可。
diff --git a/adapters/perf-data/bilibili-stat/crawler.py b/adapters/perf-data/bilibili-stat/crawler.py
new file mode 100644
index 0000000..633c516
--- /dev/null
+++ b/adapters/perf-data/bilibili-stat/crawler.py
@@ -0,0 +1,129 @@
+"""B站视频数据 + 评论抓取(公开接口,无需登录、无需签名)。
+
+与 douyin-session / xhs-explore 不同:B站的视频统计与评论都是**公开数据**——
+`view` 接口不需要 wbi 签名,评论走 `x/v2/reply` 老接口(按热度)。因此本 adapter
+是纯 httpx,零登录、零浏览器,clone 下来即可用。
+
+接口:
+- 视频数据:https://api.bilibili.com/x/web-interface/view?bvid=<BV号>
+- 评论: https://api.bilibili.com/x/v2/reply?type=1&oid=<aid>&sort=2 (sort=2 热度)
+"""
+from __future__ import annotations
+
+import re
+import sys
+import time
+
+import httpx
+
+UA = (
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
+ "(KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
+)
+HEADERS = {"User-Agent": UA, "Referer": "https://www.bilibili.com"}
+VIEW_API = "https://api.bilibili.com/x/web-interface/view"
+REPLY_API = "https://api.bilibili.com/x/v2/reply"
+
+
+def normalize_bvid(raw: str) -> str:
+ """从 BV 号或 B站视频 URL(含 b23.tv 短链跳转后)里提取 BV 号。"""
+ m = re.search(r"(BV[0-9A-Za-z]{10})", raw or "")
+ return m.group(1) if m else (raw or "").strip()
+
+
+def _client() -> httpx.Client:
+ return httpx.Client(headers=HEADERS, timeout=20, follow_redirects=True)
+
+
+def fetch_video(client: httpx.Client, bvid: str) -> dict:
+ """拉视频信息 + 统计。返回归一化后的 dict。"""
+ j = client.get(VIEW_API, params={"bvid": bvid}).json()
+ if j.get("code") != 0:
+ raise RuntimeError(f"view 接口失败 code={j.get('code')} msg={j.get('message')}")
+ d = j.get("data") or {}
+ stat = d.get("stat") or {}
+ return {
+ "bvid": d.get("bvid") or bvid,
+ "aid": d.get("aid"),
+ "title": d.get("title") or "",
+ "desc": d.get("desc") or "",
+ "owner": (d.get("owner") or {}).get("name") or "",
+ "pubdate": d.get("pubdate") or 0,
+ "duration_s": d.get("duration") or 0,
+ "play_count": stat.get("view") or 0,
+ "like_count": stat.get("like") or 0,
+ "coin_count": stat.get("coin") or 0,
+ "favorite_count": stat.get("favorite") or 0,
+ "share_count": stat.get("share") or 0,
+ "comment_count": stat.get("reply") or 0,
+ "danmaku_count": stat.get("danmaku") or 0,
+ "raw": d,
+ }
+
+
+def fetch_comments(client: httpx.Client, aid: int, max_count: int = 50) -> list[dict]:
+ """按热度(sort=2)翻页抓评论,最多 max_count 条。"""
+ out: list[dict] = []
+ seen: set[str] = set()
+ pn = 1
+ for _ in range(60): # 翻页上限保护
+ if len(out) >= max_count:
+ break
+ try:
+ j = client.get(
+ REPLY_API,
+ params={"type": 1, "oid": aid, "sort": 2, "pn": pn, "ps": 20},
+ ).json()
+ except Exception as exc:
+ print(f"[警告] 评论请求异常(停止):{exc}")
+ break
+ if j.get("code") != 0:
+ print(f"[警告] 评论接口 code={j.get('code')} msg={j.get('message')}(停止)")
+ break
+ reps = (j.get("data") or {}).get("replies") or []
+ if not reps:
+ break
+ for c in reps:
+ nc = _normalize_comment(c)
+ if nc["cid"] in seen:
+ continue
+ seen.add(nc["cid"])
+ out.append(nc)
+ pn += 1
+ time.sleep(0.4)
+ out.sort(key=lambda x: x["digg_count"], reverse=True)
+ return out[:max_count]
+
+
+def _normalize_comment(c: dict) -> dict:
+ member = c.get("member") or {}
+ content = c.get("content") or {}
+ loc = (c.get("reply_control") or {}).get("location") or ""
+ return {
+ "cid": str(c.get("rpid") or ""),
+ "text": content.get("message") or "",
+ "digg_count": c.get("like") or 0,
+ "reply_comment_total": c.get("rcount") or 0,
+ "create_time": c.get("ctime") or 0,
+ "user_name": member.get("uname") or "",
+ "ip_label": loc.replace("IP属地:", "").replace("IP属地:", "").strip() if loc else "",
+ }
+
+
+def fetch_all(bvid: str, max_comments: int = 50) -> dict:
+ """一次拉完视频数据 + 热门评论。"""
+ bvid = normalize_bvid(bvid)
+ with _client() as client:
+ print(f" → 拉取视频数据 {bvid}")
+ video = fetch_video(client, bvid)
+ print(f" ✓ {video['title'][:40]}(播放 {video['play_count']})")
+ print(" → 拉取热门评论")
+ comments = fetch_comments(client, video["aid"], max_count=max_comments)
+ print(f" ✓ {len(comments)} 条评论")
+ return {"video": video, "comments": comments}
+
+
+if __name__ == "__main__":
+ # 与 douyin-session / xhs-explore 的接口保持一致;B站公开数据无需登录。
+ if len(sys.argv) > 1 and sys.argv[1] == "login":
+ print("[B站] 视频数据与评论均为公开接口,无需登录,直接 /cheat-retro 即可。")
diff --git a/adapters/perf-data/bilibili-stat/paths.py b/adapters/perf-data/bilibili-stat/paths.py
new file mode 100644
index 0000000..c3bddde
--- /dev/null
+++ b/adapters/perf-data/bilibili-stat/paths.py
@@ -0,0 +1,33 @@
+from __future__ import annotations
+
+import os
+from pathlib import Path
+from typing import Mapping
+
+
+def runtime_project_root(
+ env: Mapping[str, str] | None = None,
+ cwd: Path | None = None,
+) -> Path:
+ active_env = env if env is not None else os.environ
+ if active_env.get("CHEAT_PROJECT_ROOT"):
+ return Path(active_env["CHEAT_PROJECT_ROOT"]).expanduser().resolve()
+ base_cwd = cwd if cwd is not None else Path.cwd()
+ return Path(base_cwd).expanduser().resolve()
+
+
+def debug_dir(
+ env: Mapping[str, str] | None = None,
+ cwd: Path | None = None,
+) -> Path:
+ return runtime_project_root(env=env, cwd=cwd) / ".cheat-cache" / "bilibili-stat-debug"
+
+
+def videos_dir(
+ env: Mapping[str, str] | None = None,
+ cwd: Path | None = None,
+) -> Path:
+ active_env = env if env is not None else os.environ
+ if active_env.get("CHEAT_VIDEOS_DIR"):
+ return Path(active_env["CHEAT_VIDEOS_DIR"]).expanduser().resolve()
+ return runtime_project_root(env=env, cwd=cwd) / "videos"
diff --git a/adapters/perf-data/bilibili-stat/renderer.py b/adapters/perf-data/bilibili-stat/renderer.py
new file mode 100644
index 0000000..5585c0b
--- /dev/null
+++ b/adapters/perf-data/bilibili-stat/renderer.py
@@ -0,0 +1,93 @@
+"""把抓到的 B站数据渲染成 NotebookLM 友好的 Markdown(与 douyin-session 同格式)。"""
+from __future__ import annotations
+
+import datetime as dt
+from pathlib import Path
+
+
+def _fmt_time(ts: int) -> str:
+ if not ts:
+ return "未知"
+ return dt.datetime.fromtimestamp(ts).strftime("%Y-%m-%d %H:%M")
+
+
+def _fmt_num(n: int | None) -> str:
+ if n is None:
+ return "-"
+ if n >= 10000:
+ return f"{n / 10000:.1f}w"
+ return str(n)
+
+
+def _fmt_duration(s: int) -> str:
+ if not s:
+ return "-"
+ return f"{s // 60}:{s % 60:02d}" if s >= 60 else f"{s}s"
+
+
+def _ratio(num: int | None, den: int | None) -> str:
+ if not num or not den:
+ return "-"
+ return f"{num / den * 100:.2f}%"
+
+
+def render_report(video: dict, script: str, comments: list[dict]) -> str:
+ lines: list[str] = []
+ title = video.get("title") or "(无标题)"
+ bvid = video["bvid"]
+ play = video.get("play_count") or 0
+
+ lines.append(f"# {title}")
+ lines.append("")
+ lines.append(f"- BV 号:`{bvid}`")
+ lines.append(f"- UP 主:{video.get('owner') or '-'}")
+ lines.append(f"- 发布时间:{_fmt_time(video.get('pubdate', 0))}")
+ lines.append(f"- 时长:{_fmt_duration(video.get('duration_s', 0))}")
+ lines.append(f"- 链接:https://www.bilibili.com/video/{bvid}")
+ lines.append(f"- 抓取时间:{dt.datetime.now().strftime('%Y-%m-%d %H:%M')}")
+ lines.append("")
+
+ lines.append("## 播放数据")
+ lines.append("")
+ lines.append(f"- 播放:{_fmt_num(play)}")
+ lines.append(f"- 点赞:{_fmt_num(video.get('like_count'))}(赞播比 {_ratio(video.get('like_count'), play)})")
+ lines.append(f"- 投币:{_fmt_num(video.get('coin_count'))}(投币率 {_ratio(video.get('coin_count'), play)})")
+ lines.append(f"- 收藏:{_fmt_num(video.get('favorite_count'))}(收藏率 {_ratio(video.get('favorite_count'), play)})")
+ lines.append(f"- 分享:{_fmt_num(video.get('share_count'))}(分播比 {_ratio(video.get('share_count'), play)})")
+ lines.append(f"- 评论:{_fmt_num(video.get('comment_count'))}")
+ lines.append(f"- 弹幕:{_fmt_num(video.get('danmaku_count'))}")
+ lines.append("")
+ lines.append("> 派生比率(赞播比 / 投币率 / 收藏率 / 分播比)是单纯播放量看不出的信号;"
+ "B站「三连率」(点赞+投币+收藏)尤其能反映内容的硬核认可度。")
+ lines.append("")
+
+ lines.append("## 原始稿子")
+ lines.append("")
+ lines.append(script.strip() if script.strip() else "(未提供)")
+ lines.append("")
+
+ lines.append(f"## 评论(按点赞降序,共 {len(comments)} 条)")
+ lines.append("")
+ if not comments:
+ lines.append("(未抓到评论,可能评论区关闭或该视频暂无评论)")
+ else:
+ for c in comments:
+ text = (c.get("text") or "").replace("\n", " ").strip()
+ reply = f" 💬{c['reply_comment_total']}" if c.get("reply_comment_total") else ""
+ loc = f" [{c['ip_label']}]" if c.get("ip_label") else ""
+ lines.append(f"- [👍{c['digg_count']}{reply}]{loc} {text}")
+ lines.append("")
+
+ return "\n".join(lines)
+
+
+def slugify(text: str, max_len: int = 30) -> str:
+ bad = '<>:"/\\|?*\n\r\t'
+ out = "".join("_" if ch in bad else ch for ch in text).strip()
+ return out[:max_len] or "untitled"
+
+
+def output_dir_for(video: dict, root: Path) -> Path:
+ date = _fmt_time(video.get("pubdate", 0))[:10].replace("未知", "nodate")
+ slug = slugify(video.get("title") or video["bvid"])
+ return root / f"{date}_{slug}"
diff --git a/adapters/perf-data/bilibili-stat/requirements.txt b/adapters/perf-data/bilibili-stat/requirements.txt
new file mode 100644
index 0000000..6ecf620
--- /dev/null
+++ b/adapters/perf-data/bilibili-stat/requirements.txt
@@ -0,0 +1 @@
+httpx>=0.27
diff --git a/adapters/perf-data/bilibili-stat/review.py b/adapters/perf-data/bilibili-stat/review.py
new file mode 100644
index 0000000..a18d54c
--- /dev/null
+++ b/adapters/perf-data/bilibili-stat/review.py
@@ -0,0 +1,61 @@
+"""发完视频后跑一次:抓 B站数据/评论 → 生成 NotebookLM 友好的 md。
+
+用法:
+ python review.py login # B站无需登录(仅为接口一致)
+ python review.py video <BV号或视频URL> [script.txt] # 直接指定视频
+"""
+from __future__ import annotations
+
+import sys
+from pathlib import Path
+
+import crawler
+import renderer
+from paths import videos_dir
+
+
+def run_with_id(bvid: str, script_path: str | None) -> None:
+ active_videos_dir = videos_dir()
+ active_videos_dir.mkdir(parents=True, exist_ok=True)
+
+ script = ""
+ if script_path:
+ p = Path(script_path).expanduser()
+ if p.is_file():
+ script = p.read_text(encoding="utf-8", errors="ignore")
+ print(f"稿子:{p.name}({len(script)} 字符)")
+ else:
+ print(f"[警告] 找不到稿子 {p}")
+
+ print(f"[抓取] 视频 {bvid}")
+ result = crawler.fetch_all(bvid)
+ video = result["video"]
+ comments = result["comments"]
+
+ out_dir = renderer.output_dir_for(video, active_videos_dir)
+ out_dir.mkdir(parents=True, exist_ok=True)
+ if script:
+ (out_dir / "script.txt").write_text(script, encoding="utf-8")
+ md = renderer.render_report(video, script, comments)
+ report = out_dir / "report.md"
+ report.write_text(md, encoding="utf-8")
+ print(f"\n✓ {report}")
+
+
+def main() -> None:
+ if len(sys.argv) > 1 and sys.argv[1] == "login":
+ print("[B站] 视频数据与评论均为公开接口,无需登录,直接复盘即可。")
+ return
+ if len(sys.argv) > 1 and sys.argv[1] == "video":
+ if len(sys.argv) < 3:
+ print("用法:python review.py video <BV号或视频URL> [script.txt]")
+ sys.exit(3)
+ bvid = sys.argv[2]
+ script_path = sys.argv[3] if len(sys.argv) > 3 else None
+ run_with_id(bvid, script_path)
+ return
+ print(__doc__)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/adapters/perf-data/bilibili-stat/run.sh b/adapters/perf-data/bilibili-stat/run.sh
new file mode 100755
index 0000000..ecddb8c
--- /dev/null
+++ b/adapters/perf-data/bilibili-stat/run.sh
@@ -0,0 +1,102 @@
+#!/usr/bin/env bash
+#
+# bilibili-stat adapter wrapper
+#
+# Called by /cheat-retro when state.data_collection=adapter and platform=bilibili.
+#
+# Usage:
+# bash run.sh <bvid_or_url> <video_folder> [<script_path>]
+#
+# Example:
+# bash run.sh BV1cUoUY9Ecr ~/my-channel/videos/2026-05-04_BV1cUoUY9Ecr_AI接入MC
+#
+# B站视频数据(view)与评论(reply)都是公开接口——无需登录、无需 wbi 签名、无需浏览器。
+# 纯 httpx,因此这个 adapter 没有 `crawler.py login` 步骤,clone 下来配好依赖即可用。
+#
+# Output: writes report.md INTO the video_folder.
+# Exit codes:
+# 0 = success (report.md written)
+# 2 = adapter dependency missing (httpx not installed)
+# 3 = other failure (network, parse error, bad bvid, etc.)
+
+set -uo pipefail
+
+BVID="${1:-}"
+VIDEO_FOLDER="${2:-}"
+SCRIPT_PATH="${3:-}"
+
+if [[ -z "$BVID" || -z "$VIDEO_FOLDER" ]]; then
+ echo "Usage: bash run.sh <bvid_or_url> <video_folder> [<script_path>]" >&2
+ exit 3
+fi
+
+# Resolve adapter source dir (where this script lives)
+ADAPTER_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+
+# Find Python — prefer venv in user's project root if exists
+PYTHON=""
+PROJECT_ROOT="$( dirname "$( dirname "$( realpath "$VIDEO_FOLDER" )" )" )"
+if [[ -x "$PROJECT_ROOT/.venv/bin/python" ]]; then
+ PYTHON="$PROJECT_ROOT/.venv/bin/python"
+elif command -v python3 >/dev/null 2>&1; then
+ PYTHON="python3"
+elif command -v python >/dev/null 2>&1; then
+ PYTHON="python"
+else
+ echo "❌ python not found — install Python 3.10+ first" >&2
+ exit 2
+fi
+
+# Verify httpx is installed
+if ! "$PYTHON" -c "import httpx" 2>/dev/null; then
+ cat >&2 <<EOF
+❌ httpx not installed.
+
+Install:
+ pip install -r "$ADAPTER_DIR/requirements.txt"
+
+Then re-run /cheat-retro.
+EOF
+ exit 2
+fi
+
+# Make sure video_folder exists
+mkdir -p "$VIDEO_FOLDER"
+
+# Resolve script path (optional)
+SCRIPT_ARG=""
+if [[ -n "$SCRIPT_PATH" && -f "$SCRIPT_PATH" ]]; then
+ SCRIPT_ARG="$SCRIPT_PATH"
+fi
+
+# Run from PROJECT_ROOT so outputs go to expected paths; override videos dir to user's
+cd "$PROJECT_ROOT"
+export CHEAT_PROJECT_ROOT="$PROJECT_ROOT"
+export CHEAT_VIDEOS_DIR="$( dirname "$VIDEO_FOLDER" )" # = user's videos/
+
+echo "[bilibili-stat] fetching $BVID into $VIDEO_FOLDER"
+if [[ -n "$SCRIPT_ARG" ]]; then
+ "$PYTHON" "$ADAPTER_DIR/review.py" video "$BVID" "$SCRIPT_ARG"
+else
+ "$PYTHON" "$ADAPTER_DIR/review.py" video "$BVID"
+fi
+
+# review.py writes to CHEAT_VIDEOS_DIR/<auto-named-folder>/report.md (named by title).
+# Move it into our canonical video_folder if names differ.
+LATEST_REPORT=$(find "$( dirname "$VIDEO_FOLDER" )" -name "report.md" -newer "$VIDEO_FOLDER" -type f 2>/dev/null | head -1)
+if [[ -n "$LATEST_REPORT" && "$( dirname "$LATEST_REPORT" )" != "$VIDEO_FOLDER" ]]; then
+ cp "$LATEST_REPORT" "$VIDEO_FOLDER/report.md"
+ AUTO_DIR=$( dirname "$LATEST_REPORT" )
+ if [[ -f "$AUTO_DIR/script.txt" ]]; then
+ cp "$AUTO_DIR/script.txt" "$VIDEO_FOLDER/script.txt"
+ fi
+ echo "[bilibili-stat] moved auto-named output to $VIDEO_FOLDER/"
+fi
+
+if [[ ! -f "$VIDEO_FOLDER/report.md" ]]; then
+ echo "❌ report.md not produced — see review.py output above for details" >&2
+ exit 3
+fi
+
+echo "✅ report.md written to $VIDEO_FOLDER/report.md"
+exit 0
diff --git a/skills/cheat-retro/SKILL.md b/skills/cheat-retro/SKILL.md
index 5718ed5..382ac80 100644
--- a/skills/cheat-retro/SKILL.md
+++ b/skills/cheat-retro/SKILL.md
@@ -96,7 +96,7 @@ allowed-tools: Bash(*), Read, Edit, Write, Glob, Grep, Skill
| `douyin` | `adapters/perf-data/douyin-session/` | `bash <adapters-dir>/douyin-session/run.sh <aweme_id> <video_folder>` |
| `xhs` | `adapters/perf-data/xhs-explore/` | `bash <adapters-dir>/xhs-explore/run.sh <note_id> <video_folder>` |
| `youtube` | `adapters/perf-data/youtube-data-api/`(待) | 调 YouTube Data API(需 API key) |
-| `bilibili` | `adapters/perf-data/bilibili-stat/`(待) | 调 B 站官方 stat 接口 |
+| `bilibili` | `adapters/perf-data/bilibili-stat/` | `bash <adapters-dir>/bilibili-stat/run.sh <bvid> <video_folder>` |
| 其他 | 无 adapter | 优雅降级到 Path A |
> `<adapters-dir>` = 克隆源码处的 `cheat-on-content/adapters/perf-data/`(install.sh **不**复制 adapter 到 ~/.claude/skills,只复制 15 个 skill)。定位:`find ~ -path '*/cheat-on-content/adapters/perf-data' -type d | head -1`。
@@ -113,6 +113,12 @@ allowed-tools: Bash(*), Read, Edit, Write, Glob, Grep, Skill
- 字段已校准(观看 `view_count` 等已写死);万一接口改版导致某项为 0,看 report.md 末尾 galaxy 原始 JSON,把新 key 加进 `crawler.py` 的 `_normalize_note`
- **评论可能抓不到**(xsec_token 缺失 / 评论关闭)→ report.md 标"未抓到评论" → 此时**降级要求用户 manual 粘 top 20 评论**(评论是真信号,不能省)
+**bilibili-stat 的特殊处理**:
+- 视频 URL(`https://www.bilibili.com/video/<BV号>` 或 b23.tv 短链)或直接给 BV 号 → adapter 自动提取 BV 号
+- **无需登录**:B站视频数据(view)与评论(reply)都是公开接口、免 wbi 签名,adapter 是纯 httpx,没有 `crawler.py login` 步骤、不碰 `.auth/`
+- 依赖 httpx:首次用 `pip install -r <adapter>/requirements.txt`
+- 评论按热度(sort=2)抓取;B站老接口主楼评论可能偏少,不足时降级 manual 粘
+
**任何 adapter 失败**(cookie 过期 / 接口变化 / 网络)→ **优雅降级到 manual**,提示用户:"adapter 调用失败,原因 [X]。改用 manual 模式——粘下面的数据"。**不阻塞流程**。
#### 共同输出