New to Claude Skills? Learn how to install them →

daymade on GitHub

Bilibili Source

Free

Fetch real-time data from Bilibili videos effortlessly.

Get this skill

Free · Opens the source repo

What Bilibili Source does

The Bilibili Source skill allows users to retrieve comprehensive metadata and live statistics for any Bilibili video without needing to log in. This includes essential data such as the video title, uploader information, publication date, view counts, likes, and more. By utilizing this skill, developers and researchers can ensure that they are working with accurate, verifiable numbers, which is crucial for analysis, reporting, and case studies. The skill supports various input formats, including BVID, av numbers, and URLs, making it versatile for different user needs.

The core functionality is provided through a straightforward Bash script, bili-fetch.sh, which returns a JSON object containing all relevant data from a single API call. This allows users to quickly access the information they need without the hassle of manual data entry or estimation. For more specific needs, additional scripts are available to fetch danmaku (bullet comments) and subtitles, although subtitles require user authentication. The skill is designed to handle network quirks and ensure data integrity, making it a reliable tool for anyone working with Bilibili content.

This skill is particularly useful for content creators, marketers, and researchers who need to analyze video performance or validate claims made by creators. By providing easy access to live metrics, it eliminates the risk of using outdated or inaccurate data. Additionally, the skill includes built-in health checks to verify functionality against the live API, ensuring that users can trust the data they retrieve.

Overall, the Bilibili Source skill is an essential tool for anyone needing accurate and up-to-date information from Bilibili videos, allowing for better analysis and reporting without the guesswork.

When to use it

Use this skill when you need reliable statistics or metadata from Bilibili videos for analysis, reporting, or research.

When not to use it

This skill is not suitable if you need subtitles without logging into Bilibili, as subtitle fetching requires user authentication.

What you can build with it

Analyzing Video Performance

Gather accurate metrics for Bilibili videos to understand viewer engagement and performance.

Validating Creator Claims

Use the skill to verify statistics claimed by video creators for authenticity.

Researching Trends

Fetch data for multiple videos to analyze trends in content consumption on Bilibili.

How to install Bilibili Source

View source

1. Install with the skills CLI

npx skills add daymade/claude-code-skills/bilibili-source --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by daymade

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

scripts/bili-fetch.sh BV1xxxxxxxxx

Returns one JSON object with everything from a single view/detail API call:

{
  "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

ScriptWhat it doesLogin
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 partNo
scripts/bili-subs.sh <ref> [browser]Subtitle/transcript trackYes
scripts/bili-selftest.shHealth-check every capability against the live APINo

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:

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.
  • 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:

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.

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:

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; update the "Verified" dates above once you re-confirm.

Frequently asked questions about Bilibili Source

Similar skills