본문으로 건너뛰기
cccskills
무료GitHub에 공개

bilibili-api

This skill should be used when the user asks to "use bilibili API", "download bilibili video", "get bilibili user info", "list bilibili favorites", "send bilibili danmaku", "upload video to bilibili", "monitor bilibili live room", "search bilibili", "get bilibili comments", or needs guidance on the bilibili_api Python library usage, authentication, API endpoints, or workflow patterns.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(121)

  • SKILL.md8.3 KB
  • references/api-modules.md6.4 KB
  • references/common-patterns.md8.6 KB
  • references/configuration.md4.8 KB
  • references/credential-setup.md6.1 KB
  • references/docs/_sidebar.md4.7 KB
  • references/docs/.gitignore13 B
  • references/docs/.nojekyll0 B
  • references/docs/b23tv.md448 B
  • references/docs/configuration.md4.3 KB
  • references/docs/DEPLOY_LOCALHOST.md310 B
  • references/docs/examples/activity.md960 B
  • references/docs/examples/app.md127 B
  • references/docs/examples/article_category.md648 B
  • references/docs/examples/article.md918 B
  • references/docs/examples/ass.md727 B
  • references/docs/examples/audio_uploader.md975 B
  • references/docs/examples/audio.md1.8 KB
  • references/docs/examples/bangumi.md3.8 KB
  • references/docs/examples/black_room.md350 B
  • references/docs/examples/channel_series.md787 B
  • references/docs/examples/cheese.md152 B
  • references/docs/examples/client.md183 B
  • references/docs/examples/comment.md2.2 KB
  • references/docs/examples/creative_center.md288 B
  • references/docs/examples/dynamic.md2.0 KB
  • references/docs/examples/emoji.md802 B
  • references/docs/examples/favorite_list.md406 B
  • references/docs/examples/festival.md3.0 KB
  • references/docs/examples/game.md1.4 KB
  • references/docs/examples/garb.md3.2 KB
  • references/docs/examples/homepage.md127 B
  • references/docs/examples/hot.md263 B
  • references/docs/examples/interactive_video.md7.9 KB
  • references/docs/examples/live_area.md349 B
  • references/docs/examples/live.md4.0 KB
  • references/docs/examples/login_v2.md5.1 KB
  • references/docs/examples/manga.md1.2 KB
  • references/docs/examples/music.md727 B
  • references/docs/examples/note.md355 B
  • references/docs/examples/opus.md1.9 KB
  • references/docs/examples/rank.md122 B
  • references/docs/examples/search.md1.3 KB
  • references/docs/examples/session.md778 B
  • references/docs/examples/show.md255 B
  • references/docs/examples/topic.md159 B
  • references/docs/examples/user.md2.5 KB
  • references/docs/examples/video_tag.md174 B
  • references/docs/examples/video_uploader.md2.0 KB
  • references/docs/examples/video_zone.md279 B
  • references/docs/examples/video.md3.8 KB
  • references/docs/examples/vote.md133 B
  • references/docs/examples/watchroom.md662 B
  • references/docs/get-credential.md3.2 KB
  • references/docs/history.html1.5 KB
  • references/docs/history.md123 B
  • references/docs/index.html2.2 KB
  • references/docs/ivifile.md3.9 KB
  • references/docs/logo-small.png12.2 KB
  • references/docs/logo.png88.6 KB
  • references/docs/modules/activity.md1.0 KB
  • references/docs/modules/app.md1.3 KB
  • references/docs/modules/article_category.md2.1 KB
  • references/docs/modules/article.md4.8 KB
  • references/docs/modules/ass.md8.2 KB
  • references/docs/modules/audio_uploader.md7.5 KB
  • references/docs/modules/audio.md3.2 KB
  • references/docs/modules/bangumi.md23.6 KB
  • references/docs/modules/bilibili_api.md38.4 KB
  • references/docs/modules/black_room.md6.1 KB
  • references/docs/modules/channel_series.md4.4 KB
  • references/docs/modules/cheese.md7.3 KB
  • references/docs/modules/client.md508 B
  • references/docs/modules/comment.md7.2 KB
  • references/docs/modules/creative_center.md14.1 KB
  • references/docs/modules/dynamic.md13.9 KB
  • references/docs/modules/emoji.md1.6 KB
  • references/docs/modules/favorite_list.md10.2 KB
  • references/docs/modules/festival.md771 B
  • references/docs/modules/game.md3.1 KB
  • references/docs/modules/garb.md5.8 KB
  • references/docs/modules/homepage.md2.2 KB
  • references/docs/modules/hot.md1.6 KB
  • references/docs/modules/interactive_video.md13.3 KB
  • references/docs/modules/live_area.md2.2 KB
  • references/docs/modules/live.md20.2 KB
  • references/docs/modules/login_v2.md6.0 KB
  • references/docs/modules/manga.md4.0 KB
  • references/docs/modules/music.md3.5 KB
  • references/docs/modules/note.md4.3 KB
  • references/docs/modules/opus.md3.3 KB
  • references/docs/modules/rank.md6.8 KB
  • references/docs/modules/README.md432 B
  • references/docs/modules/search.md5.9 KB
  • references/docs/modules/session.md6.9 KB
  • references/docs/modules/show.md3.2 KB
  • references/docs/modules/topic.md2.7 KB
  • references/docs/modules/user.md25.9 KB
  • references/docs/modules/video_tag.md1.7 KB
  • references/docs/modules/video_uploader.md9.9 KB
  • references/docs/modules/video_zone.md6.8 KB
  • references/docs/modules/video.md28.4 KB
  • references/docs/modules/vote.md3.2 KB
  • references/docs/modules/watchroom.md4.4 KB
  • references/docs/package-lock.json125.8 KB
  • references/docs/README.md9.9 KB
  • references/docs/refresh_cookies.md674 B
  • references/docs/request_client.md11.1 KB
  • references/docs/search.js6.4 KB
  • references/docs/sync-executor.md471 B
  • references/docs/target/npmlist.json268 B
  • references/docs/theme.css15.4 KB
  • references/docs/vote_id.md2.0 KB
  • references/docs/vote_source.png41.8 KB
  • references/live-guide.md5.1 KB
  • references/self-update.md5.4 KB
  • references/upload-guide.md5.9 KB
  • references/user-guide.md4.7 KB
  • references/video-guide.md6.0 KB
  • scripts/credential_check.py3.0 KB
  • scripts/quickstart.py1.2 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

bilibili-api Skill

Overview

bilibili-api (package: bilibili-api-python, v17.4.1) is a comprehensive async Python wrapper for Bilibili's APIs with 400+ endpoints across 42 modules. All operations are async (asyncio-based) with a sync wrapper available. Supports three HTTP backends: curl_cffi, aiohttp, httpx.

  • Source code: <project_root>/bilibili_api/
  • Documentation (Chinese): references/docs/
  • Module API docs: references/docs/modules/*.md
  • Usage examples: references/docs/examples/*.md

Quick Start

Install the library and at least one HTTP backend:

uv pip install bilibili-api-python aiohttp
# or: uv pip install bilibili-api-python curl_cffi
# or: uv pip install bilibili-api-python httpx

Minimal example (anonymous, no credentials needed):

import asyncio
from bilibili_api import video

async def main():
    v = video.Video(bvid="BV1uv411q7Mv")
    info = await v.get_info()
    print(info["title"], info["stat"]["view"])

asyncio.run(main())

Or use the sync wrapper:

from bilibili_api import video, sync

v = video.Video(bvid="BV1uv411q7Mv")
info = sync(v.get_info())
print(info["title"])

See scripts/quickstart.py for a runnable example.

Credential Setup

Most read operations work without credentials. Write operations (like, comment, upload) and some read operations (user history, favorites) require authentication via the Credential class.

from bilibili_api import Credential

credential = Credential(
    sessdata="...",       # Required for GET (read) operations
    bili_jct="...",       # Required for POST (write) operations
    buvid3="...",         # Device ID (auto-generated if omitted)
    buvid4="...",         # Device ID v4 (optional)
    dedeuserid="...",     # User ID (rarely needed)
    ac_time_value="...",  # For cookie refresh only
)

Extract from browser: Open bilibili.com > F12 DevTools > Application (Chrome) or Storage (Firefox) > Cookies > .bilibili.com > copy SESSDATA, bili_jct, buvid3.

Programmatic login: Use login_v2 module for QR code, password, or SMS login.

Cookie refresh: Use credential.check_refresh() and credential.refresh() when cookies expire.

For complete details, consult references/credential-setup.md. To validate credentials, run scripts/credential_check.py.

Key Modules

CategoryModuleDescriptionKey Class
ContentvideoVideo info, actions, danmaku, downloadVideo
bangumiAnime/drama seriesBangumi
articleColumn articlesArticle
audioAudio tracksAudio
mangaManga/comicsManga
cheesePaid coursesCheeseList, CheeseVideo
opusImage postsOpus
noteNotesNote
SocialuserUser profiles, followers, videosUser
dynamicUser dynamics/feedsDynamic
commentComments on any resourceComment
sessionPrivate messages(functions)
emojiEmoji/sticker packs(functions)
DiscoverysearchSearch videos/users/articles(functions)
hotTrending content(functions)
rankRankings(functions)
homepageHomepage recommendations(functions)
video_zoneVideo category zones(functions)
LiveliveLive rooms, danmaku, giftsLiveRoom, LiveDanmaku
live_areaLive streaming categories(functions)
Uploadvideo_uploaderVideo upload workflowVideoUploader
audio_uploaderAudio upload workflowAudioUploader
Accountlogin_v2Login (QR/password/SMS)QrCodeLogin
creative_centerCreator dashboard(functions)
favorite_listFavorites managementFavoriteList

For the complete list of all 42 modules with classes and methods, consult references/api-modules.md.

Core Patterns

Async Usage

All API methods are async. Standard pattern:

import asyncio
from bilibili_api import video, Credential

async def main():
    cred = Credential(sessdata="...", bili_jct="...")
    v = video.Video(bvid="BVxxxxxxxx", credential=cred)
    info = await v.get_info()
    await v.like(True)

asyncio.run(main())

Sync Wrapper

For scripts that don't need async:

from bilibili_api import sync
result = sync(v.get_info())

Note: sync() cannot be called inside an already-running event loop.

Error Handling

from bilibili_api import ResponseCodeException, NetworkException

try:
    info = await v.get_info()
except ResponseCodeException as e:
    print(f"API error {e.code}: {e.msg}")  # Bilibili API returned error
except NetworkException as e:
    print(f"HTTP error {e.status}: {e.msg}")  # Network/HTTP failure

Key exceptions: ResponseCodeException (API error code), NetworkException (HTTP error), ArgsException (bad parameters), CredentialNo*Exception (missing auth fields).

Event System (WebSocket)

Used by LiveDanmaku, VideoOnlineMonitor, uploaders:

from bilibili_api import live

room = live.LiveDanmaku(room_display_id=123456)

@room.on("DANMU_MSG")
async def on_danmaku(event):
    print(event["data"]["info"][1])  # danmaku text

await room.connect()

ID Conversion

from bilibili_api import aid2bvid, bvid2aid
bvid = aid2bvid(170001)        # -> "BV17x411w7KC"
aid = bvid2aid("BV17x411w7KC") # -> 170001

Link Parsing

from bilibili_api import parse_link, get_real_url
# Resolve b23.tv short URLs
real_url = await get_real_url("https://b23.tv/xxxxxxx")
# Parse any bilibili link to resource type + ID
resource = await parse_link(real_url)

For detailed patterns (download, danmaku, pagination, Picture class), consult references/common-patterns.md.

Configuration

from bilibili_api import request_settings, request_log, select_client

# Proxy
request_settings.set_proxy("http://127.0.0.1:7890")

# Timeout (default: 30s)
request_settings.set_timeout(60.0)

# Switch HTTP backend
select_client("curl_cffi")  # or "aiohttp", "httpx"

# Enable request logging
request_log.set_on(True)

# Anti-spider (usually automatic)
from bilibili_api import recalculate_wbi, refresh_buvid
await recalculate_wbi()  # Force WBI key refresh
await refresh_buvid()    # Force buvid refresh

For full configuration details, consult references/configuration.md.

Reference Files

Detailed References

FileDescription
references/credential-setup.mdComplete credential guide: browser extraction, programmatic login (QR/password/SMS), cookie refresh
references/api-modules.mdAll 42 modules with classes, key methods, and auth requirements
references/configuration.mdRequest settings, proxy, HTTP clients, logging, anti-spider measures
references/common-patterns.mdAsync/sync patterns, error handling, events, danmaku, download, pagination
references/video-guide.mdVideo module deep dive: info, actions, danmaku, download with quality selection
references/user-guide.mdUser module deep dive: profile, content listing, social actions, pagination
references/live-guide.mdLive module deep dive: room info, WebSocket danmaku, gift tracking
references/upload-guide.mdVideo/audio upload workflows with event monitoring
references/self-update.mdSkill self-update workflow: check for new releases, sync docs, update version info

Utility Scripts

FileDescription
scripts/quickstart.pyMinimal runnable example (anonymous video info retrieval)
scripts/credential_check.pyValidate credentials from environment variables

Source Documentation

For exhaustive API signatures, consult the project's built-in docs:

  • Module API reference: references/docs/modules/<module>.md
  • Usage examples: references/docs/examples/<module>.md

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Browser automation CLI for AI agents. Use when needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. TRIGGER when user requests to "open a website", "fill out a form", "click a button", "take a screenshot", "debug this in browser", "scrape data from a page", "test this web app", "login to a site", "frontend UI/UX aesthetics", "automate browser actions", or any task requiring programmatic web interaction.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

archibate/dotfiles-opencode1082026년 4월 29일 업데이트

Review common AI slops of defensive programming patterns, avoid silent errors. TRIGGER when reviewing code for defensive anti-patterns, writing fail-fast code, or auditing error handling quality.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

archibate/dotfiles-opencode1082026년 4월 29일 업데이트

ast-grep

무료

Guide for writing ast-grep rules to perform structural code search and analysis. This skill should be used when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search, or when a simple grep/glob search is insufficient for structural code pattern matching.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

archibate/dotfiles-opencode1082026년 4월 29일 업데이트

Best practices for AI-driven English-to-Chinese translation. This skill should be used when the user asks to "translate to Chinese", "update the Chinese translation", "improve Chinese translation", "fix translation quality", "review Chinese translation", or when translating any English text into Chinese. Also applies when polishing an existing Chinese translation of English content.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

archibate/dotfiles-opencode1082026년 4월 29일 업데이트

This skill should be used when sending images, files, or notifications back to the user via messaging platforms (Discord, Feishu, Telegram, etc.) through cc-connect. TRIGGER when agent generates a plot/chart/screenshot and wants to show the user; agent creates a report/PDF/file the user should receive; agent needs to proactively notify the user (e.g. task completed, alert, reminder); user asks to "send image", "show me the chart", "notify me", "send the file", "send to Telegram", "show plot in Discord".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

archibate/dotfiles-opencode1082026년 4월 29일 업데이트

Interact with local Chrome browser session (only on explicit user approval after being asked to inspect, debug, or interact with a page open in Chrome)

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

archibate/dotfiles-opencode1082026년 4월 29일 업데이트

archibate의 스킬 모두 보기

이 스킬의 문제 신고