哔哩哔哩来源
- 作者仓库星标 0
- 作者更新于 2026年8月24日 07:33
- 作者仓库 claude-code-skills
- 领域
- 通用
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @daymade · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
scripts/bili-fetch.sh BV1xxxxxxxxx
# bilibili-source
Fetch **real, verifiable** data for a Bilibili video so you can cite it instead of guessing. Engagement numbers are the backbone of any honest "why did this do well" analysis, and hand-typed or estimated numbers are the fastest way a knowledge base rots. This skill makes the numbers cheap to fetch — so there is no excuse to invent them.
## Quick start
```bash
scripts/bili-fetch.sh BV1xxxxxxxxx
```
Returns one JSON object with everything from a single `view/detail` API call:
```json
{
"bvid": "BV1xxxxxxxxx",
"aid": 1234567890,
"fetched_at": "2026-06-07T13:54:17Z",
"url": "https://www.bilibili.com/video/BV1xxxxxxxxx",
"title": "<video title>",
"up": { "name": "<UP name>", "mid": 12345678, "fans": 45600 },
"pubdate": "2026-01-10T00:50:47Z",
"tname": "<partition, may be empty>",
"tags": ["<tag>", "<tag>"],
"videos": 1,
"duration_s": 372,
"stat": { "view": 48000, "like": 1200, "coin": 180, "favorite": 950,
"share": 64, "reply": 210, "danmaku": 130 },
"pages": [ { "cid": 12345678, "page": 1, "part": "<part title>", "duration": 372 } ]
}
```
`bili-fetch.sh` accepts any form a user might paste — **BVID, `av` number, `b23.tv` short link, or full URL** — and normalizes it. For multi-part videos it returns every part's `cid` in `pages[]` (you need the per-part cid to fetch that part's danmaku or subtitles).
## Scripts
| Script | What it does | Login |
|--------|--------------|-------|
| `scripts/bili-fetch.sh <ref>` | Core: full metadata + live stats (run this first) | No |
| `scripts/bili-danmaku.sh <ref> [P]` | Danmaku (bullet-comment) full text for a part | No |
| `scripts/bili-subs.sh <ref> [browser]` | Subtitle/transcript track | **Yes** |
| `scripts/bili-selftest.sh` | Health-check every capability against the live API | No |
All three **execute** (don't read them as reference). `bili-danmaku.sh` reuses `bili-fetch.sh` to resolve the part's cid, so they must stay siblings in `scripts/`.
**Danmaku** are time-synced comments overlaid on the video — a Bilibili-specific signal of *where and how* viewers reacted, qualitatively richer than a flat reply count:
```bash
scripts/bili-danmaku.sh BV1xxxxxxxxx # P1; add a part number for multi-part videos
```
## Rules that keep the data honest
- **Live metrics → always cite `fetched_at`.** The same video re-fetched minutes later drifts (a view count can tick up by a few within a single session). That is not an error — it is proof the data is live. A bare "12,000 views" with no timestamp is meaningless and silently goes stale.
- **NO FABRICATION.** If a number can't be fetched, write "未获取/未核实" — never estimate. The whole point of the skill is that the number is cheap to fetch.
- **The scripts already handle the network quirks** so you don't reinvent them: they strip the local proxy (Bilibili is a domestic CN service that a `127.0.0.1` proxy breaks), send a browser User-Agent + Referer (avoids the occasional HTTP 412), and retry with backoff. If you call the API by hand, do the same — see [references/bilibili_api.md](references/bilibili_api.md).
- **CJK post-processing trap.** When you later grep/sort the fetched Chinese text or filenames, `sort`/`comm` mishandle CJK collation and report false "missing"/"broken" results. Verify with `find -name` or `grep -F`, not `comm`.
## Subtitles require login (no bypass)
Stats and danmaku are login-free. **Subtitles are not.** Verified across many videos (new and old) plus anonymous cookies: the public player API returns an empty subtitle list for anonymous requests, and `yt-dlp` reports *"Subtitles are only available when logged in."* There is **no login-free path** — do not try to bypass it.
`bili-subs.sh` therefore needs the user's Bilibili session via browser cookies. Because it reads their logged-in session, **ask the user before running it**:
```bash
scripts/bili-subs.sh BV1xxxxxxxxx chrome # or firefox / safari / edge
```
The `ai-zh` track is Bilibili's AI-generated subtitle — treat it as a draft transcript (same-sound/segmentation errors), mark it as AI-ASR in whatever you produce, and don't claim it is a human-checked verbatim. If a video has no subtitle track, there is nothing to fetch — don't invent one. A SESSDATA-env API alternative is documented in the reference.
## Going deeper
For the full endpoint catalog (UP fan history, video tags, real-time viewer count, danmaku archive, the SESSDATA subtitle path), the WBI request-signing algorithm needed for `space/wbi/*` endpoints, and every gotcha with a tested command, see **[references/bilibili_api.md](references/bilibili_api.md)**.
## Verified status
- **Stats / metadata / danmaku** (`view/detail`, `relation/stat`, `dm/list.so`, `online/total`): verified login-free, 2026-06-07. Metrics re-fetched repeatedly and matched independently; danmaku count matched `stat.danmaku`.
- **Subtitles**: confirmed login-gated, 2026-06-07 (empty for anonymous across all videos tested). Needs `yt-dlp` for the cookie path.
## Maintenance
This skill wraps a third-party API that drifts over time — fields get renamed, endpoints add WBI signing, anti-bot tightens. Before trusting it after a gap, or whenever output looks wrong, run the health-check:
```bash
scripts/bili-selftest.sh
```
It hits every capability (and the login-gate invariant) against a stable public fixture and prints one PASS/FAIL row per capability, so drift surfaces as a clear FAIL pointing at what broke — not a silent wrong answer. When a row fails, the endpoint paths, field names, and WBI signing needed to fix it are in [references/bilibili_api.md](references/bilibili_api.md); update the "Verified" dates above once you re-confirm.
章节与文件索引
按说明文件中的顺序排列。
快速启动
脚本
保持数据诚实的规则
字幕需要登录(不可绕过)
更深入
文件/命令 -> view/detail · bili-fetch.sh · b23.tv · cid · pages[] · scripts/bili-fetch.sh <ref> · scripts/bili-danmaku.sh <ref> [P] · scripts/bili-subs.sh <ref> [browser]
内容校验值 -> 7648d7a3b09c
当前原文的自动摘译,尚未人工审校。
快速启动
返回一个 JSON 对象,其中包含来自单个
view/detailAPI 调用的所有内容:bili-fetch.sh接受用户可能粘贴的任何形式 — BVID、av数字、b23.tv短链接或完整 URL — 并将其标准化。对于多部分视频,它返回pages[]中每个部分的cid(您需要每个部分的 cid 来获取该部分的弹幕或字幕)。脚本
脚本 · 它的作用 · 登录
scripts/bili-fetch.sh <ref>· 核心:完整元数据 + 实时统计(首先运行此) · 否scripts/bili-danmaku.sh <ref> [P]· 弹幕(项目符号注释)部分全文 · 否scripts/bili-subs.sh <ref> [browser]· 字幕/脚本轨道 · 是scripts/bili-selftest.sh· 根据实时 API 检查每个功能的健康状况 · 否保持数据诚实的规则
实时指标 → 始终引用
fetched_at。几分钟后重新获取的相同视频会发生漂移(在单个会话中观看次数可能会增加一些)。这不是一个错误——它证明了数据是实时的。没有时间戳的光秃秃的“12,000 次浏览”毫无意义,并且会默默地变得陈旧。没有捏造。如果无法获取号码,请写“未获取/未解锁”——永远不要估计。该技能的全部要点在于获取该号码的成本低廉。字幕需要登录(不可绕过)
统计和弹幕无需登录。字幕不是。经过许多视频(新的和旧的)以及匿名 cookie 的验证:公共播放器 API 针对匿名请求返回一个空的字幕列表,并且
yt-dlp报告 “字幕仅在登录时可用。” 没有免登录路径 - 不要尝试绕过它。因此,bili-subs.sh需要通过浏览器cookie来访问用户的Bilibili会话。因为它会读取用户的登录会话,所以在运行之前询问用户:更深入
有关完整的端点目录(UP 粉丝历史记录、视频标签、实时观看者计数、弹幕存档、SESSDATA 字幕路径)、
space/wbi/*端点所需的 WBI 请求签名算法以及经过测试的命令的每个问题,请参阅references/bilibili_api.md。