Bilibili Hub logo

Bilibili Hub

Organization
OpenMinis
bilibili-hub

A skill for reading and writing Bilibili data with Python + UV, using bilibili-api-python + aiohttp. It automatically obtains cookies through `browser_use get_cookies` for authentication, so no manual copying is required. Supports video details, subtitles, AI summaries, comments, user profiles, search, popular videos/rankings, following dynamics feed, favorites, Watch Later, viewing history, interactions (likes, coins, triple action), publishing and deleting dynamics, and more. When a user mentions "Bilibili," "bilibili," "Bilibili videos," "Bilibili popular," "bilibili-hub," "get Bilibili data," "Bilibili subtitles," "Bilibili comments," "Bilibili favorites," "Bilibili dynamics," or any scenario that requires programmatically reading or writing Bilibili content, this skill must be triggered.

Overview

PublisherOpenMinis
RepositoryMinisSkills
Skill namebilibili-hub
Stars
543
Forks
86
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by OpenMinis on GitHub. Read the source before you install it.

Installation

Install the Bilibili Hub AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/OpenMinis/MinisSkills/tree/main/bilibili-hub
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OpenMinis/MinisSkills.git /tmp/MinisSkills
mkdir -p .claude/skills
cp -r /tmp/MinisSkills/bilibili-hub .claude/skills/bilibili-hub
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Bilibili Hub in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Bilibili Hub on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Bilibili Hub is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

bilibili-hub

Modified from: jackwener/bilibili-cli (Apache-2.0)

This skill simplifies and modifies the original repository as follows:

  • Removed the browser-cookie3 / click / rich / PyYAML / qrcode dependencies
  • Changed cookie authentication to accept a dict directly or read from environment variables, without automatic browser extraction
  • Removed the CLI layer (commands/), QR login, formatters, and related components
  • Kept all API methods and wrapped them uniformly as synchronous interfaces (asyncio.run)
  • Core dependency: bilibili-api-python, a third-party SDK that reverse engineers the Bilibili API
  • In the Minis environment, cookies are obtained automatically through browser_use get_cookies

File Structure

/var/minis/skills/bilibili-hub/
├── SKILL.md
├── pyproject.toml          # bilibili-api-python + aiohttp
└── scripts/
    ├── __init__.py
    ├── exceptions.py       # 6 structured exception types
    ├── payloads.py         # Data structure normalization (normalize_* functions)
    └── client.py           # BiliClient core class (all API methods)

Authentication Methods

The Bilibili Web API uses three key cookies:

CookieDescription
SESSDATAUser session (required for read operations)
bili_jctCSRF token (required for write operations: likes, coins, posting dynamics, etc.)
DedeUserIDUser ID (recommended)
buvid3Device ID (recommended; reduces the likelihood of triggering risk control)

Method 1: Automatically retrieve via browser_use (preferred in Minis environments)

  1. Use browser_use navigate to open https://www.bilibili.com and confirm that you are logged in.
  2. Use browser_use get_cookies to retrieve cookies (raw values do not appear in the conversation).
  3. Load the offload env file:
bash
. /var/minis/offloads/env_cookies_www_bilibili_com_xxx.sh
export BILI_SESSDATA="$COOKIE_SESSDATA"
export BILI_JCT="$COOKIE_BILI_JCT"
export BILI_USERID="$COOKIE_DEDEUSERID"
export BILI_BUVID3="$COOKIE_BUVID3"

Note: get_cookies only applies to the current page's domain. Navigate to https://www.bilibili.com before calling it.

Method 2: Manually retrieve from browser DevTools

  1. Log in to Bilibili, then open DevTools -> Application -> Cookies -> https://www.bilibili.com.
  2. Find the values of SESSDATA, bili_jct, and DedeUserID.
  3. Store them in the Minis environment variables: BILI_SESSDATA / BILI_JCT / BILI_USERID.

Ways to pass cookies (three methods)

python
# Method 1: From environment variables (recommended)
client = BiliClient.from_env()

# Method 2: Pass a dict directly
client = BiliClient({
    "SESSDATA":   os.environ["BILI_SESSDATA"],
    "bili_jct":   os.environ["BILI_JCT"],
    "DedeUserID": os.environ["BILI_USERID"],
})

# Method 3: Read-only operations (no write permissions required)
client = BiliClient({"SESSDATA": os.environ["BILI_SESSDATA"]})

Quick Start

Environment setup

bash
cd /var/minis/skills/bilibili-hub
uv sync

Calling as a Python library

python
import os, json, sys
sys.path.insert(0, "/var/minis/skills/bilibili-hub")
from scripts.client import BiliClient

client = BiliClient.from_env()

# Current user information
me = client.whoami()
print("User:", me.get("name"), "UID:", me.get("mid"))

# Search videos
videos = client.search_videos("Python Tutorial", count=5)
for v in videos:
    print(f"  {v['bvid']} {v['title']} ({v['duration']})")

# Get video details (including subtitles)
detail = client.get_video("BV1xx411c7mD", subtitle=True)
print(detail["video"]["title"])
print(detail["subtitle"]["text"][:200])

# Popular videos
hot = client.get_hot(count=10)
for v in hot:
    print(f"  {v['bvid']} {v['title']} 👁{v['stats']['view']}")

API Method Quick Reference

Account

MethodDescription
whoami()Get information about the currently logged-in user

Video

MethodDescription
get_video(bvid, *, subtitle, subtitle_timeline, ai_summary, comments, related)Get video details (optional subtitles/AI summary/comments/related videos)

bvid supports a BV number or full URL and is extracted automatically.

Users

MethodDescription
get_user(uid)Get user profile information + following/follower counts
get_user_videos(uid, count=20)Get videos posted by a user

Search

MethodDescription
search_videos(keyword, page=1, count=20)Search videos
search_users(keyword, page=1)Search users

Discover

MethodDescription
get_hot(page=1, count=20)Site-wide popular videos
get_rank(day=3, count=50)Site-wide rankings (day: 1/3/7)
get_feed(offset=0)Following dynamics feed (login required)
get_my_dynamics(offset=0)Dynamics I published (login required)
post_dynamic(text)Post a text dynamic (login + bili_jct required)
delete_dynamic(dynamic_id)Delete a dynamic (login + bili_jct required)

Favorites / History

MethodDescription
get_favorites()Get the favorites folder list (login required)
get_favorites(folder_id)Get videos in a favorites folder
get_following(page=1)Get the following list (login required)
get_watch_later()Get the Watch Later list (login required)
get_history()Get viewing history (login required)

Download

MethodDescription
download_video(bvid, output_dir, filename=None)Download the full video (mp4), automatically handling DASH merging
download_audio(bvid, output_dir, filename=None)Download only the audio stream (m4a), suitable for ASR transcription

Download process:

  • DASH streams (common): download the video stream and audio stream separately -> merge with ffmpeg copy -> if merging fails, keep the silent video
  • FLV/MP4 streams (rare): download directly, no merging required
  • Without logging in, downloads are limited to 480P; after logging in, 1080P is available (premium members can download higher quality)
MethodDescription
like(bvid) / like(bvid, undo=True)Like / unlike (requires bili_jct)
coin(bvid, num=1)Give 1 or 2 coins (requires bili_jct)
triple(bvid)Perform the one-click triple action (requires bili_jct)
unfollow(uid)Unfollow a user (requires bili_jct)

Error Handling

python
from scripts.exceptions import (
    AuthenticationError,  # Cookie missing or expired
    RateLimitError,       # Triggered risk control (412)
    NotFoundError,        # Video/user does not exist
    NetworkError,         # Network/timeout error
    InvalidBvidError,     # Invalid BV number format
    BiliError,            # Other API error (base class)
)

try:
    detail = client.get_video("BV1xx411c7mD")
except AuthenticationError:
    print("Cookie has expired. Please retrieve it again.")
except RateLimitError:
    print("Risk control triggered. Try again later.")
except NotFoundError:
    print("Video does not exist.")
except BiliError as e:
    print(f"API error: {e}")

Important Notes

  • SESSDATA is the minimum requirement for read operations. Write operations (likes, coins, posting dynamics) also require bili_jct.
  • Cookies are usually valid for several days to several weeks. After they expire, retrieve them again through browser_use get_cookies.
  • Bilibili applies risk control to high-frequency requests (HTTP 412). An operation interval of at least 1 second is recommended.
  • bilibili-api-python is a community-maintained reverse-engineering project, and its interfaces may break when Bilibili updates.
  • Write operations (coins, triple action, etc.) cannot be reversed. Use them with caution.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Bilibili Hub AI skill do?

A skill for reading and writing Bilibili data with Python + UV, using bilibili-api-python + aiohttp. It automatically obtains cookies through `browser_use get_cookies` for authentication, so no manual copying is required. Supports video details, subtitles, AI summaries, comments, user profiles, search, popular videos/rankings, following dynamics feed, favorites, Watch Later, viewing history, interactions (likes, coins, triple action), publishing and deleting dynamics, and more. When a user mentions "Bilibili," "bilibili," "Bilibili videos," "Bilibili popular," "bilibili-hub," "get Bilibili...

Why use Bilibili Hub on TypingMind?

Because you install it once and use it with any model. Bilibili Hub is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Bilibili Hub in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/OpenMinis/MinisSkills/tree/main/bilibili-hub. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Bilibili Hub?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Bilibili Hub?

As many as you like. As long as a model supports skills, you can use Bilibili Hub with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Bilibili Hub AI skill free?

Yes. It is published on GitHub by OpenMinis under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇