summarize-bilibili-video
Fetch a specified Bilibili video's existing official or AI subtitle track and produce a concise Chinese summary grounded in timestamped transcript evidence. Use when a user provides a bilibili.com video URL or BV id and asks to 获取字幕, AI 字幕, 提取视频内容, summarize, 总结, 提炼要点, or compare an extracted transcript with an SRT reference. Supports multi-part videos, a logged-in Chrome fallback when public APIs hide subtitle URLs, deterministic transcript artifacts, and subtitle-to-SRT validation. Do not use this skill to transcribe videos that have no existing subtitle track.
Works with
Agent Skills format with YAML frontmatter. Claude Code reads it as-is.
---
name: "summarize-bilibili-video"
description: "Fetch a specified Bilibili video's existing official or AI subtitle track and produce a concise Chinese summary grounded in timestamped transcript evidence. Use when a user provides a bilibili.com video URL or BV id and asks to 获取字幕, AI 字幕, 提取视频内容, summarize, 总结, 提炼要点, or compare an extracted transcript with an SRT reference. Supports multi-part videos, a logged-in Chrome fallback when public APIs hide subtitle URLs, deterministic transcript artifacts, and subtitle-to-SRT validation. Do not use this skill to transcribe videos that have no existing subtitle track."
license: "MIT"
---
# Summarize Bilibili Video
Fetch the existing subtitle track first, then summarize only what that transcript supports. Prefer the zero-dependency script and use logged-in Chrome only when Bilibili hides the subtitle URL from public requests.
## Workflow
1. Run the public fast path:
```bash
python3 "<skill>/scripts/fetch_subtitles.py" "<video-url-or-bvid>" --out "<work-dir>"
```
2. Read `<work-dir>/result.json` and `<work-dir>/transcript.md`. If the command succeeds, skip browser work.
3. If it exits with code `2` and reports `login_required`, use the Chrome browser skill. Open the exact video page in the user's existing signed-in Chrome session. Do not inspect or copy cookies, storage, profiles, or credentials.
4. In the page origin, request this read-only endpoint with `credentials: "include"`:
```text
https://api.bilibili.com/x/player/wbi/v2?bvid=<BVID>&cid=<CID>
```
5. Save only this sanitized shape to a temporary JSON file; exclude account, IP, VIP, and unrelated response fields:
```json
{"code": 0, "message": "OK", "data": {"subtitle": {"subtitles": []}}}
```
6. Re-run with the browser response. The signed subtitle URL is short-lived; do not log it or preserve its query string in durable artifacts.
```bash
python3 "<skill>/scripts/fetch_subtitles.py" "<video-url-or-bvid>" \
--out "<work-dir>" --player-json "<temporary-player-response.json>"
```
7. Delete the temporary browser response after the transcript is downloaded. Keep the generated redacted manifest and transcript artifacts.
8. Summarize from `transcript.md`, not from Bilibili's own AI conclusion. Use the output structure below.
## Subtitle Selection
Select the first usable track by this fixed priority:
1. AI Chinese: `lan=ai-zh` or another Chinese track marked as AI.
2. Official Chinese.
3. Any other usable track.
Never treat an empty `subtitle_url` as a usable track. If the public response lists a track but hides its URL, take the Chrome fallback once. If Chrome also returns no usable track, stop with a precise coverage statement; do not silently switch to audio download or ASR.
For multi-part videos, honor `--page`; otherwise honor `?p=` in the supplied URL; otherwise use part 1. Verify that `result.json` reports the requested page and expected `cid`.
## Summary Format
Write in Chinese unless the user asks otherwise:
```markdown
# <video title>
## 一句话总结
<one grounded conclusion>
## 核心内容
- <claim or idea> `[MM:SS]`
- <claim or idea> `[MM:SS]`
## 展开脉络
### <topic> `[MM:SS-MM:SS]`
<what the speaker says, preserving qualifications and causal links>
## 关键判断
- <speaker's judgment, evidence, caveat, or open question>
## 字幕覆盖
<track type, segment count, time span, and any visible evidence limitation>
```
Do not invent scene details that are absent from subtitles. Distinguish the speaker's claims from your synthesis. Preserve uncertainty and disagreement. For a long transcript, summarize consecutive time blocks first, then synthesize across blocks; never sample by deleting alternating lines.
## Reference Comparison
When the user supplies an SRT reference, compare it after extraction:
```bash
python3 "<skill>/scripts/compare_subtitles.py" \
--actual "<work-dir>/subtitle.srt" --reference "<reference.srt>" \
--json-out "<work-dir>/comparison.json"
```
Treat the reference as validation evidence only. Do not use it as the summary source before the skill's own extraction succeeds. Report segment counts, end-time drift, normalized text similarity, and pass/fail. The default acceptance is text similarity at least `0.98` and end-time drift at most `2.0` seconds.
## Failure Rules
- `invalid_input`: ask for a valid Bilibili video URL or BV id.
- `page_not_found`: report available part count.
- `login_required`: use the single Chrome fallback.
- `no_subtitle`: report that no existing subtitle track is available; do not claim the video has no speech.
- `rate_limited` or `network_error`: retry only through the script's bounded retry policy, then report the failure.
- `invalid_response`: stop rather than summarize incomplete or malformed data.
Read [references/api-and-design-notes.md](references/api-and-design-notes.md) only when debugging endpoint drift or revising the extraction strategy.More General & Other skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

