Bilibili Hubのロゴ

Bilibili Hub

組織
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.

概要

公開者OpenMinis
リポジトリMinisSkills
スキル名bilibili-hub
スター
543
フォーク
86
同梱ファイル
5
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 5個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    OpenMinisがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Bilibili Hub」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/OpenMinis/MinisSkills/tree/main/bilibili-hub
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでBilibili Hubを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にBilibili Hubを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Bilibili Hubは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「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...

TypingMindでBilibili Hubを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Bilibili Hubはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにBilibili Hubをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/OpenMinis/MinisSkills/tree/main/bilibili-hubを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Bilibili Hubを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Bilibili Hubで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもBilibili Hubを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Bilibili Hub」は無料ですか?

はい。OpenMinisがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇