{"id":"9e9367de-d635-4c9d-8964-129c745cff09","shortId":"qvsmsm","kind":"skill","title":"bbc-skill","tagline":"Fetch Bilibili (哔哩哔哩) video comments for UP主 self-analysis. Use when the user asks to collect, download, export, or analyze comments on a Bilibili video (BV号 / URL / UID). Produces JSONL + summary.json suitable for further Claude Code analysis (sentiment, keywords, audience trend","description":"# bbc-skill — Bilibili Comment Collector\n\nDownload all comments (top-level + nested + pinned) for a Bilibili video and\nproduce data that Claude Code can analyze downstream.\n\n## Update check\n\nThrottle to one check per 24 hours per installation; never mutate the skill directory without explicit user consent.\n\n1. If `<this-skill-dir>/.last_update` exists and is less than 24 hours old, skip this step entirely.\n\n2. Otherwise, fetch the latest tag from upstream:\n\n   ```bash\n   git -C <this-skill-dir> ls-remote --tags origin 'v*' 2>/dev/null \\\n     | awk '{print $2}' | sed 's|refs/tags/||' \\\n     | sort -V | tail -1\n   ```\n\n3. Compare with this skill's `metadata.version` from the frontmatter. If the upstream tag is strictly newer (semver), tell the user one line and ask:\n\n   > \"A newer version of this skill is available: vX.Y.Z → vA.B.C. Want me to `git pull`?\"\n\n   If they say yes, run `git -C <this-skill-dir> pull --ff-only`. Refresh `.last_update` either way so the prompt doesn't repeat for 24 hours.\n\n4. If upstream is the same or older, refresh `.last_update` silently and continue.\n\n5. On any failure (offline, not a git checkout — e.g. ClawHub-installed copy, read-only path, no permission), swallow the error silently and continue with the user's task. Do not mention the failure.\n\n## When to use\n\nTrigger this skill when the user:\n\n- Asks to **get / fetch / download / export / collect / analyze** comments of a\n  specific Bilibili video (BV 号, URL, or video page).\n- Asks to analyze **audience feedback / sentiment / keywords / top comments /\n  IP distribution** of their own Bilibili videos.\n- Provides a Bilibili URL like `https://www.bilibili.com/video/BVxxxxxxxxxx/`.\n- Mentions their UP主 UID and wants batch analysis across their videos.\n\nDo **not** use for: posting / deleting comments, downloading videos, barrage\n(弹幕), live stream data, or private messages.\n\n## Prerequisites\n\n1. **Python 3.9+** (stdlib only — zero pip install).\n2. **Bilibili cookie**. The user must be logged in to bilibili.com. The\n   recommended path:\n   - Install the Chrome/Edge extension\n     [**Get cookies.txt LOCALLY**](https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc)\n     (open-source, fully local, no upload).\n   - On a logged-in bilibili.com tab, click **Export** → save\n     `www.bilibili.com_cookies.txt`.\n   - Pass via `--cookie-file` or set `$BBC_COOKIE_FILE`.\n\n   Alternatives:\n   - `$BBC_SESSDATA` env var with just the SESSDATA value.\n   - Browser auto-detection (Firefox / Chrome / Edge on macOS) via\n     `--browser auto`. Works best for Firefox; Chrome/Edge needs a logged-in\n     profile with cookies flushed to disk.\n\n**Auth delegation (Principle 7):** the skill never runs OAuth flows. The human\nis expected to log in via browser; the agent only consumes the resulting\ncookie.\n\n## Quick start\n\nBefore any fetch, verify the cookie works:\n\n```bash\npython3 -m bbc cookie-check\n```\n\nSuccess envelope (stdout):\n```json\n{\"ok\":true,\"data\":{\"mid\":441831884,\"uname\":\"探索未至之境\",\"vip\":false}}\n```\n\nFetch all comments for a single video:\n\n```bash\npython3 -m bbc fetch BV1NjA7zjEAU\n```\n\nOr pass a URL:\n\n```bash\npython3 -m bbc fetch \"https://www.bilibili.com/video/BV1NjA7zjEAU/\"\n```\n\nOutput (default `./bilibili-comments/<BV>/`):\n- `comments.jsonl` — one comment per line, flattened\n- `summary.json` — video metadata + statistics + top-N\n- `raw/` — archived API responses\n- `.bbc-state.json` — resume state\n\n## Commands\n\n| Command | Purpose |\n|---|---|\n| `bbc fetch <BV\\|URL>` | Fetch all comments for one video |\n| `bbc fetch-user <UID>` | Batch fetch all videos of a UP主 |\n| `bbc summarize <dir>` | Rebuild `summary.json` from existing `comments.jsonl` |\n| `bbc cookie-check` | Validate cookie; print logged-in user |\n| `bbc schema [cmd]` | Return JSON schema for commands (for agent discovery) |\n\nCall `bbc <cmd> --help` or `bbc schema <cmd>` for full parameter details — do\nnot guess flag names.\n\n## Agent contract\n\n### Stdout vs stderr\n\n- **stdout**: stable JSON envelope `{\"ok\":true,\"data\":...}` or\n  `{\"ok\":false,\"error\":...}`. JSON is the default when stdout is not a TTY.\n  Pass `--format table` for human-readable tables.\n- **stderr**: human log lines + NDJSON progress events for long tasks.\n\n### Exit codes\n\n| Code | Meaning |\n|---|---|\n| 0 | Success |\n| 1 | Runtime / API error |\n| 2 | Auth error (cookie invalid / missing) |\n| 3 | Validation error (bad BV number, bad flag) |\n| 4 | Network error (timeout / retries exhausted) |\n\n### Error envelope\n\n```json\n{\n  \"ok\": false,\n  \"error\": {\n    \"code\": \"auth_expired\",\n    \"message\": \"SESSDATA 已过期，请重新登录 B 站\",\n    \"retryable\": true,\n    \"retry_after_auth\": true\n  }\n}\n```\n\nError codes: `validation_error`, `auth_required`, `auth_expired`, `not_found`,\n`rate_limited`, `api_error`, `network_error`. See `bbc schema` for the full\ncontract.\n\n### Dry-run\n\nEvery fetch command supports `--dry-run` to preview the planned request\nwithout making network calls:\n\n```bash\npython3 -m bbc fetch BV1NjA7zjEAU --dry-run\n```\n\n### Idempotency\n\nRe-running the same `fetch` command on the same output directory resumes from\n`.bbc-state.json` (skips already-fetched pages). Pass `--force` to refetch.\n\n## Analysis workflow (for the agent)\n\nAfter `fetch` completes:\n\n1. **Read `summary.json` first** (< 10 KB) to establish global context: video\n   metadata, total counts, time distribution, top-N.\n2. **For thematic analysis**, `Grep` or `head`/`tail` on `comments.jsonl` —\n   each line is a flat JSON object, never load the whole file unless small.\n3. **Typical analyses**:\n   - Sentiment distribution → scan `message` by batch\n   - Top fans → group by `mid`, count entries, aggregate `like`\n   - UP 主互动 → filter `is_up_reply=true`\n   - Audience geography → `ip_location` histogram\n   - Feedback timeline → bucket `ctime_iso` by day/week\n\nThe `summary.json` schema is documented in `references/agent-contract.md`.\nRun the skill against any video to produce a real sample locally.\n\n## Safety tier\n\nAll commands are **read-only** (tier: `open`). No mutation, no deletion, no\nmessage sending. Dry-run available for all fetch commands.\n\n## References\n\n- `references/api-endpoints.md` — Bilibili API fields used\n- `references/cookie-extraction.md` — per-browser cookie decryption\n- `references/agent-contract.md` — full envelope + schema contract\n\n## Limitations\n\n- `all_count` returned by the API includes pinned comments. Completeness\n  check: `top_level + nested + pinned == declared_all_count`.\n- Very old comments (>2 years) may return thin data if the user was deleted.\n- Anti-bot: aggressive `--max` values or repeated runs may trigger HTTP 412.\n  The client sleeps 1s between requests and backs off on 412.","tags":["bbc","skill","agents365-ai","agent-skills","bilibili","bilibili-api","claude-code","claude-code-skill","claude-skills","openclaw","openclaw-skills","python"],"capabilities":["skill","source-agents365-ai","skill-bbc-skill","topic-agent-skills","topic-bilibili","topic-bilibili-api","topic-claude-code","topic-claude-code-skill","topic-claude-skills","topic-openclaw","topic-openclaw-skills","topic-python","topic-skill-md","topic-skillsmp","topic-up-main"],"categories":["bbc-skill"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/Agents365-ai/bbc-skill","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add Agents365-ai/bbc-skill","source_repo":"https://github.com/Agents365-ai/bbc-skill","install_from":"skills.sh"}},"qualityScore":"0.456","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 12 github stars · SKILL.md body (6,704 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:07:11.819Z","embedding":null,"createdAt":"2026-05-01T13:04:47.112Z","updatedAt":"2026-05-18T19:07:11.819Z","lastSeenAt":"2026-05-18T19:07:11.819Z","tsv":"'-1':136 '/.last_update':95 '/bilibili-comments':514 '/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc)':365 '/dev/null':126 '/video/bv1nja7zjeau/':511 '/video/bvxxxxxxxxxx/':304 '0':651 '1':93,334,653,782 '10':786 '1s':972 '2':108,125,129,342,657,801,945 '24':80,101,200 '3':137,663,825 '3.9':336 '4':202,671 '412':968,979 '441831884':482 '5':216 '7':435 'across':313 'agent':452,586,603,778 'aggreg':841 'aggress':959 'alreadi':767 'already-fetch':766 'altern':394 'analys':827 'analysi':13,41,312,774,804 'analyz':24,71,268,283 'anti':957 'anti-bot':956 'api':530,655,710,909,929 'archiv':529 'ask':18,161,261,281 'audienc':44,284,850 'auth':432,658,684,696,702,704 'auto':406,415 'auto-detect':405 'avail':169,901 'awk':127 'b':690 'back':976 'bad':666,669 'barrag':325 'bash':116,467,494,504,740 'batch':311,552,833 'bbc':2,47,391,395,470,497,507,538,548,559,566,577,589,592,715,743 'bbc-skill':1,46 'bbc-state.json':532,764 'best':417 'bilibili':5,28,49,62,273,295,299,343,908 'bilibili.com':352,378 'bot':958 'browser':404,414,450,915 'bucket':857 'bv':275,540,667 'bv1nja7zjeau':499,745 'bv号':30 'c':118,183 'call':588,739 'check':74,78,473,569,934 'checkout':224 'chrome':409 'chrome/edge':358,420 'chromewebstore.google.com':364 'chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc)':363 'claud':39,68 'clawhub':227 'clawhub-instal':226 'click':380 'client':970 'cmd':579 'code':40,69,648,649,683,699 'collect':20,267 'collector':51 'command':535,536,584,726,756,884,905 'comment':8,25,50,54,269,289,322,489,517,544,932,944 'comments.jsonl':515,565,810 'compar':138 'complet':781,933 'consent':92 'consum':454 'context':791 'continu':215,241 'contract':604,720,922 'cooki':344,387,392,428,457,465,472,568,571,660,916 'cookie-check':471,567 'cookie-fil':386 'cookies.txt':361 'copi':229 'count':795,839,925,941 'ctime':858 'data':66,329,480,614,950 'day/week':861 'declar':939 'decrypt':917 'default':513,622 'deleg':433 'delet':321,894,955 'detail':597 'detect':407 'directori':88,761 'discoveri':587 'disk':431 'distribut':291,797,829 'document':866 'doesn':196 'download':21,52,265,323 'downstream':72 'dri':722,729,747,899 'dry-run':721,728,746,898 'e.g':225 'edg':410 'either':191 'entir':107 'entri':840 'env':397 'envelop':475,611,678,920 'error':238,618,656,659,665,673,677,682,698,701,711,713 'establish':789 'event':643 'everi':724 'exhaust':676 'exist':96,564 'exit':647 'expect':445 'expir':685,705 'explicit':90 'export':22,266,381 'extens':359 'failur':219,251 'fals':486,617,681 'fan':835 'feedback':285,855 'fetch':4,110,264,462,487,498,508,539,542,550,553,725,744,755,768,780,904 'fetch-us':549 'ff':186 'ff-on':185 'field':910 'file':388,393,822 'filter':845 'firefox':408,419 'first':785 'flag':601,670 'flat':815 'flatten':520 'flow':441 'flush':429 'forc':771 'format':630 'found':707 'frontmatt':146 'full':595,719,919 'fulli':369 'geographi':851 'get':263,360 'git':117,175,182,223 'global':790 'grep':805 'group':836 'guess':600 'head':807 'help':590 'histogram':854 'hour':81,102,201 'http':967 'human':443,634,638 'human-read':633 'idempot':749 'includ':930 'instal':83,228,341,356 'invalid':661 'ip':290,852 'iso':859 'json':477,581,610,619,679,816 'jsonl':34 'kb':787 'keyword':43,287 'last':189,211 'latest':112 'less':99 'level':57,936 'like':301,842 'limit':709,923 'line':159,519,640,812 'live':327 'load':819 'local':362,370,880 'locat':853 'log':349,376,424,447,574,639 'logged-in':375,423,573 'long':645 'ls':120 'ls-remot':119 'm':469,496,506,742 'maco':412 'make':737 'max':960 'may':947,965 'mean':650 'mention':249,305 'messag':332,686,831,896 'metadata':523,793 'metadata.version':143 'mid':481,838 'miss':662 'must':347 'mutat':85,892 'n':527,800 'name':602 'ndjson':641 'need':421 'nest':58,937 'network':672,712,738 'never':84,438,818 'newer':153,163 'number':668 'oauth':440 'object':817 'offlin':220 'ok':478,612,616,680 'old':103,943 'older':209 'one':77,158,516,546 'open':367,890 'open-sourc':366 'origin':123 'otherwis':109 'output':512,760 'page':280,769 'paramet':596 'pass':384,501,629,770 'path':233,355 'per':79,82,518,914 'per-brows':913 'permiss':235 'pin':59,931,938 'pip':340 'plan':734 'post':320 'prerequisit':333 'preview':732 'principl':434 'print':128,572 'privat':331 'produc':33,65,876 'profil':426 'progress':642 'prompt':195 'provid':297 'pull':176,184 'purpos':537 'python':335 'python3':468,495,505,741 'quick':458 'rate':708 'raw':528 're':751 're-run':750 'read':231,783,887 'read-on':230,886 'readabl':635 'real':878 'rebuild':561 'recommend':354 'refer':906 'references/agent-contract.md':868,918 'references/api-endpoints.md':907 'references/cookie-extraction.md':912 'refetch':773 'refresh':188,210 'refs/tags':132 'remot':121 'repeat':198,963 'repli':848 'request':735,974 'requir':703 'respons':531 'result':456 'resum':533,762 'retri':675,694 'retryabl':692 'return':580,926,948 'run':181,439,723,730,748,752,869,900,964 'runtim':654 'safeti':881 'sampl':879 'save':382 'say':179 'scan':830 'schema':578,582,593,716,864,921 'sed':130 'see':714 'self':12 'self-analysi':11 'semver':154 'send':897 'sentiment':42,286,828 'sessdata':396,402,687 'set':390 'silent':213,239 'singl':492 'skill':3,48,87,141,167,257,437,871 'skill-bbc-skill' 'skip':104,765 'sleep':971 'small':824 'sort':133 'sourc':368 'source-agents365-ai' 'specif':272 'stabl':609 'start':459 'state':534 'statist':524 'stderr':607,637 'stdlib':337 'stdout':476,605,608,624 'step':106 'stream':328 'strict':152 'success':474,652 'suitabl':36 'summar':560 'summary.json':35,521,562,784,863 'support':727 'swallow':236 'tab':379 'tabl':631,636 'tag':113,122,150 'tail':135,808 'task':246,646 'tell':155 'themat':803 'thin':949 'throttl':75 'tier':882,889 'time':796 'timelin':856 'timeout':674 'top':56,288,526,799,834,935 'top-level':55 'top-n':525,798 'topic-agent-skills' 'topic-bilibili' 'topic-bilibili-api' 'topic-claude-code' 'topic-claude-code-skill' 'topic-claude-skills' 'topic-openclaw' 'topic-openclaw-skills' 'topic-python' 'topic-skill-md' 'topic-skillsmp' 'topic-up-main' 'total':794 'trend':45 'trigger':255,966 'true':479,613,693,697,849 'tti':628 'typic':826 'uid':32,308 'unam':483 'unless':823 'updat':73,190,212 'upload':372 'upstream':115,149,204 'up主':10,307,558 'url':31,277,300,503,541 'use':14,254,318,911 'user':17,91,157,244,260,346,551,576,953 'v':124,134 'va.b.c':171 'valid':570,664,700 'valu':403,961 'var':398 'verifi':463 'version':164 'via':385,413,449 'video':7,29,63,274,279,296,315,324,493,522,547,555,792,874 'vip':485 'vs':606 'vx.y.z':170 'want':172,310 'way':192 'whole':821 'without':89,736 'work':416,466 'workflow':775 'www.bilibili.com':303,510 'www.bilibili.com/video/bv1nja7zjeau/':509 'www.bilibili.com/video/bvxxxxxxxxxx/':302 'www.bilibili.com_cookies.txt':383 'year':946 'yes':180 'zero':339 '主互动':844 '号':276 '哔哩哔哩':6 '已过期':688 '弹幕':326 '探索未至之境':484 '站':691 '请重新登录':689","prices":[{"id":"1787097f-0388-4a46-baba-60dd2d38b972","listingId":"9e9367de-d635-4c9d-8964-129c745cff09","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"Agents365-ai","category":"bbc-skill","install_from":"skills.sh"},"createdAt":"2026-05-01T13:04:47.112Z"}],"sources":[{"listingId":"9e9367de-d635-4c9d-8964-129c745cff09","source":"github","sourceId":"Agents365-ai/bbc-skill","sourceUrl":"https://github.com/Agents365-ai/bbc-skill","isPrimary":false,"firstSeenAt":"2026-05-01T13:04:47.112Z","lastSeenAt":"2026-05-18T19:07:11.819Z"}],"details":{"listingId":"9e9367de-d635-4c9d-8964-129c745cff09","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"Agents365-ai","slug":"bbc-skill","github":{"repo":"Agents365-ai/bbc-skill","stars":12,"topics":["agent-skills","bilibili","bilibili-api","claude-code","claude-code-skill","claude-skills","openclaw","openclaw-skills","python","skill-md","skillsmp","up-main"],"license":null,"html_url":"https://github.com/Agents365-ai/bbc-skill","pushed_at":"2026-05-05T08:19:34Z","description":"Agent-native CLI for fetching Bilibili video comments (UP主 self-analysis). Zero dependencies. Claude Code / Codex / OpenClaw support.","skill_md_sha":"68004a83d9e79966330dc64c3627f586a0fbb975","skill_md_path":"SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/Agents365-ai/bbc-skill"},"layout":"root","source":"github","category":"bbc-skill","frontmatter":{"name":"bbc-skill","license":"MIT","description":"Fetch Bilibili (哔哩哔哩) video comments for UP主 self-analysis. Use when the user asks to collect, download, export, or analyze comments on a Bilibili video (BV号 / URL / UID). Produces JSONL + summary.json suitable for further Claude Code analysis (sentiment, keywords, audience trends). Read-only; does not post/edit/delete."},"skills_sh_url":"https://skills.sh/Agents365-ai/bbc-skill"},"updatedAt":"2026-05-18T19:07:11.819Z"}}