К основному содержанию
скилл CX Codex

bilibili — скилл для Claude Code: статьи и установка

Скилл читает статистику статей в Bilibili и помогает публиковать новые через ваш аккаунт. Для работы нужны cookies входа.

Apache-2.0 175 установок ★ 17 обновлён 2026-10-25

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add AceDataCloud/Skills --skill bilibili -a claude-code
Открыть на GitHub

Что делает bilibili

Скилл показывает, кто вошёл в аккаунт Bilibili, выводит список опубликованных статей со статистикой просмотров, лайков и комментариев, а также открывает данные отдельной статьи. Можно посмотреть черновики, статус отправленных материалов и доступные категории. Данные берутся через скрипт scripts/bilibili.py на Python 3; для запросов он использует стандартную библиотеку Python.

Для доступа передаются cookies аккаунта, включая SESSDATA и токен bili_jct. Скрипт также умеет отправлять статью из HTML-файла и переносить внешние изображения на CDN Bilibili. Публикация по умолчанию запускается в режиме предварительного просмотра: для отправки нужен завершающий флаг --confirm, а после подтверждения материал попадает на проверку Bilibili. Отправленную статью нельзя снять из очереди через этот CLI, поэтому перед публикацией проверьте предварительный просмотр.

Какие задачи решает

  • проверить, какой аккаунт Bilibili подключён
  • посмотреть просмотры, лайки и комментарии к статьям
  • найти нужную статью по её статистике
  • сохранить новую статью как черновик
  • отправить статью на проверку Bilibili

Примеры запросов агенту

  • Покажи мои статьи в Bilibili и статистику просмотров, лайков и комментариев.
  • Проверь статистику статьи cv12345 и статус последних отправок.
  • Подготовь публикацию из article.html, сначала покажи предварительный просмотр и дождись моего подтверждения.

Как установить bilibili

1Через Skills CLI (Vercel)

npx skills add AceDataCloud/Skills --skill bilibili -a claude-code

2Вручную: положить файлы

~/.claude/skills/bilibili/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/bilibili/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о bilibili

Как установить bilibili в Claude Code?

Выполните npx skills add AceDataCloud/Skills --skill bilibili -a claude-code. Файл скилла появится по пути ~/.claude/skills/bilibili/SKILL.md.

Что делает скилл bilibili?

Он читает список статей и их статистику, проверяет отдельные материалы и помогает отправлять новые статьи через аккаунт Bilibili.

Что нужно для работы с bilibili?

Нужны cookies авторизованного аккаунта, переданные через BILIBILI_COOKIES. Публикация сначала показывает предварительный просмотр, а для отправки требует --confirm в конце команды.

Исходный текст

SKILL.md · Apache-2.0
---
name: bilibili
description: Read and publish 专栏 articles on Bilibili (bilibili.com) with the user's own login cookies (BYOC) — list their published articles with view/like/comment stats, inspect one article, and publish a new article. Use when the user mentions Bilibili / B站 / 专栏, "我的B站专栏", reading article stats (阅读/点赞), or publishing/投稿 a 专栏 article.
when_to_use: |
  Trigger for anything on the user's Bilibili (bilibili.com) 专栏 account driven
  by their own login cookie: show who they are, list their published 专栏
  articles with view / like / comment counts, look at one article's stats, or
  publish a new 专栏 article. This acts as the user's real account, so writes are
  gated behind an explicit confirmation.
connections: [bilibili]
allowed_tools: [Bash]
license: Apache-2.0
metadata:
  author: acedatacloud
  version: "1.0"
---

# bilibili — read & publish 专栏 via your own cookies

Drives the user's **real** Bilibili 专栏 (article) account through the same
`api.bilibili.com` web endpoints the site uses, authenticated by the login
cookie they captured with the ACE extension. No browser, no third-party deps —
`urllib` + `hashlib` (the article-list read endpoint needs WBI signing, done
with stdlib).

The connector injects the cookie jar as an env var:

- `BILIBILI_COOKIES` — a JSON array of cookies. **Secret — never echo or print
  it.** It includes `SESSDATA` (auth) and `bili_jct` (the CSRF token used for
  writes).

## CLI

The skill ships [`scripts/bilibili.py`](scripts/bilibili.py) — self-contained, stdlib only.

```sh
# $SKILL_DIR can point at another skill loaded this turn — anchor on our own
# script, and re-run this at the top of every Bash block (fresh shell each time).
BILI="$SKILL_DIR/scripts/bilibili.py"; [ -f "$BILI" ] || BILI=$(find /tmp -maxdepth 8 -path '*/skills/*/scripts/bilibili.py' 2>/dev/null | head -1)
[ -f "$BILI" ] || { echo "bilibili script not found (SKILL_DIR=$SKILL_DIR)" >&2; exit 1; }
python3 "$BILI" whoami                     # who is logged in (mid, name)
python3 "$BILI" articles --limit 20        # my 专栏 articles + stats
python3 "$BILI" article <cvid>             # one article's stats (cv id)
python3 "$BILI" drafts --limit 50          # list saved drafts (aid + title)
python3 "$BILI" status --limit 10          # review state of recent submissions
python3 "$BILI" categories                 # 分类 names accepted by --category
```

Stats come straight from Bilibili: `view` (阅读), `like` (点赞), `reply` (评论),
`favorite` (收藏), `coin` (投币).

## Verify the connection first

```sh
BILI="$SKILL_DIR/scripts/bilibili.py"; [ -f "$BILI" ] || BILI=$(find /tmp -maxdepth 8 -path '*/skills/*/scripts/bilibili.py' 2>/dev/null | head -1)
python3 "$BILI" whoami
# → {"mid": 10000000, "name": "...", "level": 4}
```

On a not-logged-in / auth error the cookie is expired — have the user reconnect
at <https://studio.acedata.cloud/console/connectors>. Do **not** loop-retry.

## Publishing — GATED (dry-run unless trailing `--confirm`)

`publish` writes to the user's real account. 专栏 content is **HTML**. Without a
trailing `--confirm` it dry-runs. `--confirm` is honored **only as the last
argument**. Always show the dry-run, get an explicit "yes", then re-run.

```sh
BILI="$SKILL_DIR/scripts/bilibili.py"; [ -f "$BILI" ] || BILI=$(find /tmp -maxdepth 8 -path '*/skills/*/scripts/bilibili.py' 2>/dev/null | head -1)
python3 "$BILI" publish --title "标题" --content-file a.html                       # dry-run
python3 "$BILI" publish --title "标题" --content-file a.html --draft-only --confirm   # save a draft
python3 "$BILI" publish --title "标题" --content-file a.html --confirm                # save draft + submit (publish)
python3 "$BILI" publish --title "标题" --content-file a.html --category 数码 --confirm  # pick the 分类
```

- `--draft-only` saves a draft (no submit) — safe; finish/publish in the editor.
  Prefer it when the user has not clearly asked to go public: a submitted
  article enters a review queue this CLI cannot withdraw it from.
- The **submit** (go public) step is frequently rate-limited by Bilibili
  risk-control (HTTP 412). When that happens the CLI reports the saved draft +
  edit URL so the user can publish from the web editor.
- `--category` picks the 分类 (default **数码**, which suits technical posts).
  Run `categories` for the accepted names. The result echoes the 分类 actually
  used as `category` / `category_id` — report it when it wasn't the user's pick.

### Publishing is not instant — it enters a review queue

A successful `submit` returns `state: -2` (**待审核**) and `pending_review: true`.
The returned `url` **404s for everyone until Bilibili approves it** (usually
minutes to hours). Tell the user it is pending; do not claim it is live, and do
not re-submit. Check later with `status`, which is the only view that shows
pending/rejected articles (the public list omits them):

```sh
python3 "$BILI" status --limit 5    # state_desc: 待审核 / 已发布 / 未通过 (+ reason)
```

Other states are **not** pending and will never go live on their own — the CLI
returns them with `ok: false` and `published: false` (`-1` 未通过 rejected, `-3`
锁定, `-4` 已删除). Read `state_desc`, tell the user plainly, and check `status`
for the `reason` rather than re-submitting.

The `id` in the publish result is the **article id** (use `cv<id>`), which is a
different number from `draft_aid`. Only ever share the `url` field. If Bilibili
returned no article id, `url` and `id` are `null` and `id_unverified: true` is
set — there is nothing shareable yet, so find the article with `status` instead
of constructing a link from `draft_aid`.

## Managing drafts (the 999-draft cap)

Bilibili caps 专栏 drafts at **999**; once full, saving a new draft fails with
`code 37106 草稿数已达最大上限`. List drafts and delete the ones you don't need:

```sh
BILI="$SKILL_DIR/scripts/bilibili.py"; [ -f "$BILI" ] || BILI=$(find /tmp -maxdepth 8 -path '*/skills/*/scripts/bilibili.py' 2>/dev/null | head -1)
python3 "$BILI" drafts --limit 50                       # list (aid + title)
python3 "$BILI" delete-draft <aid> <aid2> ...           # dry-run (shows what would delete)
python3 "$BILI" delete-draft <aid> <aid2> ... --confirm # PERMANENTLY delete those drafts
```

- `delete-draft` is **GATED** (dry-run unless trailing `--confirm`) and deletion
  is **permanent** — always show the dry-run + the titles and get an explicit
  "yes" before `--confirm`. Pass multiple aids to batch a few per call.
- Never bulk-delete blindly: list first, confirm the titles are junk/duplicates.

## Images

`publish` automatically re-hosts external images (both `<img src>` and markdown)
onto Bilibili's CDN (`i0.hdslb.com` / `article.biliimg.com`) before saving —
Bilibili hotlink-blocks external images and rejects the whole article (`37130`)
if any external link remains. webp sources (which upcover rejects) are
transcoded to png via the CDN when possible; an image that still can't upload is
**dropped** from the article rather than failing the post. `--no-rehost-images`
skips this.

## Gotchas

- **This is the user's real Bilibili account.** Confirm before any publish.
- **submit may 412** (anti-bot) even when the draft saved fine — the draft is the
  reliable result; don't loop-retry submit.
- A 分类 the account can't post to returns `-17`; without `--category` the CLI
  auto-retries the fallback list.
- **Never print `BILIBILI_COOKIES`** — it is full account access.
- **ToS**: acts only on the user's own account with their own captured cookie.


## Record the output

After you successfully publish and obtain the live result URL, call the built-in
`publish_artifact` tool ONCE so the user can track this deliverable in **My Outputs**:

```
publish_artifact(kind="article", channel="bilibili", title="<title>", url="<the REAL returned URL>", status="delivered")
```

Use the real returned URL — never fabricate one. That is the `url` field of the
publish result (built from the article `id`, **not** `draft_aid`). Call it once
per published item, only after delivery is confirmed.

- `state: 0` or `1` (已发布, live) → `status="delivered"`.
- `pending_review: true` (待审核) → `status="draft"`; the URL is not live yet.
  Re-record as delivered later if the user asks you to re-check with `status`.
- rejected/locked states, a 412-blocked submit, `id_unverified: true`, or
  `state_unknown: true` → `status="failed"` (or skip it).

See `_shared/artifacts.md`.

© acedatacloud · Apache-2.0 · AceDataCloud/Skills

Похожие скиллы

Каталог скиллов SKILL.md →
bilibili-subtitle HamsteRider-m Скилл bilibili-subtitle для Claude Code достаёт субтитры из видео Bilibili через BBDown и раскладывает их в Markdown, SRT и VTT. Извлекает текст ролика без необходимости смотреть само видео. CX Codex +1 1 300установок jkvideo-bilibili-react-native reason-machines Скилл jkvideo-bilibili-react-native помогает разрабатывать мобильный клиент Bilibili на базе React Native 0.83 и Expo SDK 55. Нужен при настройке DASH, WBI-подписи и стриминга. CX Codex +1 887установок bilibili-cli jackwener Скилл bilibili-cli даёт агенту CLI-доступ к Bilibili: видео, пользователи, поиск, тренды, динамика, избранное и взаимодействия. Вывод в YAML экономит токены. CX Codex +1 792установок bilibili-source daymade Скилл bilibili-source для Claude Code и пяти других платформ: запрашивает реальные метаданные, статистику, теги и данмаку с Bilibili через API без авторизации. Работает с BVID, av-номерами, ссылками b23.tv и полными URL. CX Codex +1 471установок Bilibili MCP Server XZXZZX-Ai Сервер даёт ИИ-агенту доступ к поиску видео на Bilibili, субтитрам, комментариям и коллекциям. Нужен Node.js 20+ и настройка входа в аккаунт. CX Codex +1 ★ 54звёзд репо bilibili-huasheng-video superlcr MCP-сервер bilibili-huasheng-video для сборки готовых видеороликов через сервис Huasheng. Автоматизирует раскадровку, подбор видеоряда и наложение озвучки прямо из ИИ-чата. CX Codex +1 ★ 20звёзд репо

Из того же набора67

Весь набор →
tiktok Публикует готовые видео в профиль TikTok или загружает их в черновики через API v2. Скилл запрашивает подтверждение настроек приватности перед каждой отправкой. CX Codex +1 178установок google-analytics Скилл для Claude и других агентов: тянет отчёты Google Analytics 4 и список свойств через Analytics API, работая из оболочки на curl и jq. CX Codex +1 177установок google-ads Запрашивает через Google Ads API кампании, группы объявлений, ключевые слова и расходы. Получает данные о кликах и конверсиях для отчётов. CX Codex +1 177установок vercel Скилл проверяет сборки, читает логи ошибок и управляет доменами на Vercel через REST API прямо из чата с агентом. CX Codex +1 176установок figma Читает файлы Figma через REST API: дерево документа, отдельные ноды, рендер в PNG и комментарии. Запускается при переводе макета в код. CX Codex +1 175установок google-docs Позволяет читать, создавать и редактировать документы Google Docs через официальный REST API с помощью curl и jq. CX Codex +1 175установок personal-wechat Скилл personal-wechat подключает Claude Code к личному WeChat через собственный сервер Wisdom: агент читает чаты и контакты, а перед отправкой сообщений запрашивает подтверждение. CX Codex +1 162установок tencent-docs Скилл открывает агенту доступ к вашему аккаунту Tencent Docs через открытый API: создавать файлы, читать содержимое, искать по диску и разбирать папки. CX Codex +1 157установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой