bilibili-hub

Read and write Bilibili data via Python using bilibili-api-python with cookie authentication.

1|Updated Jun 20, 2026
One-click install
npx skills add https://github.com/riipandi/minis-skills --skill bilibili-hub-riipandi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bilibili-hub
Source: https://github.com/riipandi/minis-skills/tree/main/bilibili-hub
Command: npx skills add https://github.com/riipandi/minis-skills --skill bilibili-hub-riipandi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bilibili-api-python, aiohttp, and includes scripts (resource) components.

What problem does it solve? Accessing Bilibili content programmatically requires handling reverse-engineered APIs, cookie-based authentication, and fragmented data formats. This Skill provides a unified Python client that fetches video details, subtitles, comments, user profiles, trending lists, and performs write actions like liking, coining, and posting dynamics without manual API wrangling. ## Core Features & Use Cases - Video & Content Retrieval: Fetch video details, subtitles, AI summaries, comments, related videos, and download video/audio streams with automatic DASH merging via ffmpeg. - Account & Social Operations: Read favorites, watch later, history, following feeds, and perform write actions like like/coin/triple, post or delete dynamics, and unfollow users. - Search & Discovery: Search videos and users, pull site-wide trending and ranking lists. - Use Case: Ask the assistant to summarize a Bilibili video — it auto-acquires cookies via browser_use, fetches subtitles and the AI summary, and returns a structured digest. ## Quick Start Ask the assistant to get the subtitles and AI summary of a Bilibili video by pasting its URL or BV ID.

Frequently Asked Questions about bilibili-hub

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get Bilibili video subtitles with Python?

Use the BiliClient get_video method with subtitle=True to fetch plain-text subtitles, or subtitle_timeline=True for timestamped items. It locates the video's cid, queries the player info endpoint, and downloads the subtitle JSON, preferring Chinese tracks.

How to download Bilibili videos programmatically?

Call download_video with a BV ID or URL. DASH streams are downloaded as separate video and audio files then merged with ffmpeg in copy mode; FLV/MP4 streams download directly. Unauthenticated downloads cap at 480P, logged-in at 1080P.

What cookies does the Bilibili API need for authentication?

SESSDATA is required for read operations, while write actions like liking, coining, or posting dynamics also need bili_jct as a CSRF token. DedeUserID and buvid3 are recommended to reduce anti-spam risk. Cookies can be auto-acquired via browser_use get_cookies.

Why does the Bilibili API return a 412 error?

HTTP 412 means Bilibili's anti-spam rate limiting was triggered, mapped to RateLimitError in the client. Reduce request frequency to at least one second between calls and retry later; including a buvid3 cookie also lowers risk.

Can I use bilibili-api-python without logging in?

Yes, read-only endpoints like video details, search, trending, and rankings work without credentials by constructing BiliClient without cookies. Login is required for favorites, history, feeds, AI summaries, and all write operations.