Fetch real, verifiable Bilibili video data so you can cite it instead of guessing. Hand-typed/estimated engagement numbers are how a knowledge base rots — these scripts make the numbers cheap to fetch.
Quick start
scripts/bili-fetch.sh BV1xxxxxxxxx
Returns one JSON object from a single view/detail call: bvid, aid, fetched_at, url, title, up (name/mid/fans), pubdate, tname (partition), tags, duration_s, stat (view/like/coin/favorite/share/reply/danmaku), and pages[] (per-part cid/page/part/duration). Accepts BVID, av number, b23.tv short link, or full URL — normalizes all.
Scripts
| Script |
Does |
Login |
bili-fetch.sh <ref> |
Core: metadata + live stats (run first) |
No |
bili-danmaku.sh <ref> [P] |
Danmaku (time-synced bullet comments) full text for a part |
No |
bili-subs.sh <ref> [browser] |
Subtitle/transcript track |
Yes |
bili-selftest.sh |
Health-check every capability vs live API |
No |
All execute (don't read as reference). bili-danmaku.sh reuses bili-fetch.sh to resolve the part's cid — keep them siblings. Danmaku are a Bilibili-specific signal of where/how viewers reacted, richer than a flat reply count.
Rules that keep data honest
- Live metrics → always cite
fetched_at. Re-fetched minutes later it drifts — that's proof it's live; a bare "12,000 views" with no timestamp silently goes stale.
- No fabrication. If a number can't be fetched, write "未获取/未核实" — never estimate.
- Network quirks handled by the scripts: they strip the local proxy (Bilibili is a CN service a 127.0.0.1 proxy breaks), send browser UA + Referer (avoids HTTP 412), retry with backoff. Do the same if calling by hand.
- CJK collation trap: when grepping/sorting fetched Chinese text,
sort/comm mishandle CJK and report false "missing". Verify with find -name or grep -F, not comm.
Subtitles require login (no bypass)
Stats/danmaku are login-free; subtitles are NOT — the public API returns an empty list for anonymous requests. bili-subs.sh needs the user's browser cookies — ask before running. The ai-zh track is AI-generated; treat as a draft transcript, mark it AI-ASR, don't claim verbatim.
Maintenance
Third-party API drifts (field renames, WBI signing, anti-bot). Run scripts/bili-selftest.sh after a gap or when output looks wrong — one PASS/FAIL row per capability surfaces drift instead of a silent wrong answer.
1---2name: bilibili-video-data-fetcher3description: Use when working with a Bilibili (B站) video and you need real, citable numbers or metadata — stats, UP follower count, tags, per-part cids, full danmaku — instead of hand-typing or estimating. Accepts BVID/av/b23.tv/URL.4tags: [bilibili, b站, video, danmaku, stats, scraping, metadata, api, citable, login-free]5source: daymade/claude-code-skills6derived_from: bilibili-source7metadata:8 source: https://skillmd.com/skills/aashutosh396/bilibili-video-data-fetcher9---1011Fetch **real, verifiable** Bilibili video data so you can cite it instead of guessing. Hand-typed/estimated engagement numbers are how a knowledge base rots — these scripts make the numbers cheap to fetch.1213## Quick start14```bash15scripts/bili-fetch.sh BV1xxxxxxxxx16```17Returns one JSON object from a single `view/detail` call: bvid, aid, `fetched_at`, url, title, up (name/mid/fans), pubdate, tname (partition), tags, duration_s, stat (view/like/coin/favorite/share/reply/danmaku), and pages[] (per-part cid/page/part/duration). Accepts BVID, av number, b23.tv short link, or full URL — normalizes all.1819## Scripts20| Script | Does | Login |21|--------|------|-------|22| `bili-fetch.sh <ref>` | Core: metadata + live stats (run first) | No |23| `bili-danmaku.sh <ref> [P]` | Danmaku (time-synced bullet comments) full text for a part | No |24| `bili-subs.sh <ref> [browser]` | Subtitle/transcript track | **Yes** |25| `bili-selftest.sh` | Health-check every capability vs live API | No |2627All execute (don't read as reference). `bili-danmaku.sh` reuses `bili-fetch.sh` to resolve the part's cid — keep them siblings. Danmaku are a Bilibili-specific signal of *where/how* viewers reacted, richer than a flat reply count.2829## Rules that keep data honest30- **Live metrics → always cite `fetched_at`.** Re-fetched minutes later it drifts — that's proof it's live; a bare "12,000 views" with no timestamp silently goes stale.31- **No fabrication.** If a number can't be fetched, write "未获取/未核实" — never estimate.32- **Network quirks handled by the scripts:** they strip the local proxy (Bilibili is a CN service a 127.0.0.1 proxy breaks), send browser UA + Referer (avoids HTTP 412), retry with backoff. Do the same if calling by hand.33- **CJK collation trap:** when grepping/sorting fetched Chinese text, `sort`/`comm` mishandle CJK and report false "missing". Verify with `find -name` or `grep -F`, not `comm`.3435## Subtitles require login (no bypass)36Stats/danmaku are login-free; subtitles are NOT — the public API returns an empty list for anonymous requests. `bili-subs.sh` needs the user's browser cookies — ask before running. The `ai-zh` track is AI-generated; treat as a draft transcript, mark it AI-ASR, don't claim verbatim.3738## Maintenance39Third-party API drifts (field renames, WBI signing, anti-bot). Run `scripts/bili-selftest.sh` after a gap or when output looks wrong — one PASS/FAIL row per capability surfaces drift instead of a silent wrong answer.