Skip to content

archibate/dotfiles-opencode / skills/bilibili-api

bilibili-api

Flagged

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.

FileKindSize
SKILL.mdskill md8.3 KB
references/api-modules.mdmarkdown6.4 KB
references/common-patterns.mdmarkdown8.6 KB
references/configuration.mdmarkdown4.8 KB
references/credential-setup.mdmarkdown6.1 KB
references/docs/.gitignoreother13 B
references/docs/.nojekyllother0 B
references/docs/DEPLOY_LOCALHOST.mdmarkdown310 B
references/docs/README.mdmarkdown9.9 KB
references/docs/_sidebar.mdmarkdown4.7 KB
references/docs/b23tv.mdmarkdown448 B
references/docs/configuration.mdmarkdown4.3 KB
references/docs/examples/activity.mdmarkdown960 B
references/docs/examples/app.mdmarkdown127 B
references/docs/examples/article.mdmarkdown918 B
references/docs/examples/article_category.mdmarkdown648 B
references/docs/examples/ass.mdmarkdown727 B
references/docs/examples/audio.mdmarkdown1.8 KB
references/docs/examples/audio_uploader.mdmarkdown975 B
references/docs/examples/bangumi.mdmarkdown3.8 KB
references/docs/examples/black_room.mdmarkdown350 B
references/docs/examples/channel_series.mdmarkdown787 B
references/docs/examples/cheese.mdmarkdown152 B
references/docs/examples/client.mdmarkdown183 B
references/docs/examples/comment.mdmarkdown2.2 KB
references/docs/examples/creative_center.mdmarkdown288 B
references/docs/examples/dynamic.mdmarkdown2.0 KB
references/docs/examples/emoji.mdmarkdown802 B
references/docs/examples/favorite_list.mdmarkdown406 B
references/docs/examples/festival.mdmarkdown3.0 KB
references/docs/examples/game.mdmarkdown1.4 KB
references/docs/examples/garb.mdmarkdown3.2 KB
references/docs/examples/homepage.mdmarkdown127 B
references/docs/examples/hot.mdmarkdown263 B
references/docs/examples/interactive_video.mdmarkdown7.9 KB
references/docs/examples/live.mdmarkdown4.0 KB
references/docs/examples/live_area.mdmarkdown349 B
references/docs/examples/login_v2.mdmarkdown5.1 KB
references/docs/examples/manga.mdmarkdown1.2 KB
references/docs/examples/music.mdmarkdown727 B
references/docs/examples/note.mdmarkdown355 B
references/docs/examples/opus.mdmarkdown1.9 KB
references/docs/examples/rank.mdmarkdown122 B
references/docs/examples/search.mdmarkdown1.3 KB
references/docs/examples/session.mdmarkdown778 B
references/docs/examples/show.mdmarkdown255 B
references/docs/examples/topic.mdmarkdown159 B
references/docs/examples/user.mdmarkdown2.5 KB
references/docs/examples/video.mdmarkdown3.8 KB
references/docs/examples/video_tag.mdmarkdown174 B
references/docs/examples/video_uploader.mdmarkdown2.0 KB
references/docs/examples/video_zone.mdmarkdown279 B
references/docs/examples/vote.mdmarkdown133 B
references/docs/examples/watchroom.mdmarkdown662 B
references/docs/get-credential.mdmarkdown3.2 KB
references/docs/history.htmlother1.5 KB
references/docs/history.mdmarkdown123 B
references/docs/index.htmlother2.2 KB
references/docs/ivifile.mdmarkdown3.9 KB
references/docs/logo-small.pngbinary12.2 KB
references/docs/logo.pngbinary88.6 KB
references/docs/modules/README.mdmarkdown432 B
references/docs/modules/activity.mdmarkdown1.0 KB
references/docs/modules/app.mdmarkdown1.3 KB
references/docs/modules/article.mdmarkdown4.8 KB
references/docs/modules/article_category.mdmarkdown2.1 KB
references/docs/modules/ass.mdmarkdown8.2 KB
references/docs/modules/audio.mdmarkdown3.2 KB
references/docs/modules/audio_uploader.mdmarkdown7.5 KB
references/docs/modules/bangumi.mdmarkdown23.6 KB
references/docs/modules/bilibili_api.mdmarkdown38.4 KB
references/docs/modules/black_room.mdmarkdown6.1 KB
references/docs/modules/channel_series.mdmarkdown4.4 KB
references/docs/modules/cheese.mdmarkdown7.3 KB
references/docs/modules/client.mdmarkdown508 B
references/docs/modules/comment.mdmarkdown7.2 KB
references/docs/modules/creative_center.mdmarkdown14.1 KB
references/docs/modules/dynamic.mdmarkdown13.9 KB
references/docs/modules/emoji.mdmarkdown1.6 KB
references/docs/modules/favorite_list.mdmarkdown10.2 KB
references/docs/modules/festival.mdmarkdown771 B
references/docs/modules/game.mdmarkdown3.1 KB
references/docs/modules/garb.mdmarkdown5.8 KB
references/docs/modules/homepage.mdmarkdown2.2 KB
references/docs/modules/hot.mdmarkdown1.6 KB
references/docs/modules/interactive_video.mdmarkdown13.3 KB
references/docs/modules/live.mdmarkdown20.2 KB
references/docs/modules/live_area.mdmarkdown2.2 KB
references/docs/modules/login_v2.mdmarkdown6.0 KB
references/docs/modules/manga.mdmarkdown4.0 KB
references/docs/modules/music.mdmarkdown3.5 KB
references/docs/modules/note.mdmarkdown4.3 KB
references/docs/modules/opus.mdmarkdown3.3 KB
references/docs/modules/rank.mdmarkdown6.8 KB
references/docs/modules/search.mdmarkdown5.9 KB
references/docs/modules/session.mdmarkdown6.9 KB
references/docs/modules/show.mdmarkdown3.2 KB
references/docs/modules/topic.mdmarkdown2.7 KB
references/docs/modules/user.mdmarkdown25.9 KB
references/docs/modules/video.mdmarkdown28.4 KB
references/docs/modules/video_tag.mdmarkdown1.7 KB
references/docs/modules/video_uploader.mdmarkdown9.9 KB
references/docs/modules/video_zone.mdmarkdown6.8 KB
references/docs/modules/vote.mdmarkdown3.2 KB
references/docs/modules/watchroom.mdmarkdown4.4 KB
references/docs/package-lock.jsonmanifest125.8 KB
references/docs/refresh_cookies.mdmarkdown674 B
references/docs/request_client.mdmarkdown11.1 KB
references/docs/search.jsscript6.4 KB
references/docs/sync-executor.mdmarkdown471 B
references/docs/target/npmlist.jsonconfig268 B
references/docs/theme.cssother15.4 KB
references/docs/vote_id.mdmarkdown2.0 KB
references/docs/vote_source.pngbinary41.8 KB
references/live-guide.mdmarkdown5.1 KB
references/self-update.mdmarkdown5.4 KB
references/upload-guide.mdmarkdown5.9 KB
references/user-guide.mdmarkdown4.7 KB
references/video-guide.mdmarkdown6.0 KB
scripts/credential_check.pyscript3.0 KB
scripts/quickstart.pyscript1.2 KB

references/docs/modules/dynamic.md

View on GitHub
# Module dynamic.py


bilibili_api.dynamic

动态相关


``` python
from bilibili_api import dynamic
```

- [class BuildDynamic()](#class-BuildDynamic)
  - [def \_\_init\_\_()](#def-\_\_init\_\_)
  - [def add\_at()](#def-add\_at)
  - [def add\_emoji()](#def-add\_emoji)
  - [def add\_image()](#def-add\_image)
  - [def add\_plain\_text()](#def-add\_plain\_text)
  - [def add\_text()](#def-add\_text)
  - [def add\_vote()](#def-add\_vote)
  - [def create\_by\_args()](#def-create\_by\_args)
  - [def empty()](#def-empty)
  - [def get\_attach\_card()](#def-get\_attach\_card)
  - [async def get\_contents()](#async-def-get\_contents)
  - [def get\_dynamic\_type()](#def-get\_dynamic\_type)
  - [def get\_options()](#def-get\_options)
  - [def get\_pics()](#def-get\_pics)
  - [def get\_topic()](#def-get\_topic)
  - [def set\_attach\_card()](#def-set\_attach\_card)
  - [def set\_options()](#def-set\_options)
  - [def set\_send\_time()](#def-set\_send\_time)
  - [def set\_topic()](#def-set\_topic)
- [class Dynamic()](#class-Dynamic)
  - [def \_\_init\_\_()](#def-\_\_init\_\_)
  - [async def delete()](#async-def-delete)
  - [def get\_dynamic\_id()](#def-get\_dynamic\_id)
  - [async def get\_info()](#async-def-get\_info)
  - [async def get\_likes()](#async-def-get\_likes)
  - [async def get\_lottery\_info()](#async-def-get\_lottery\_info)
  - [async def get\_reaction()](#async-def-get\_reaction)
  - [async def get\_reposts()](#async-def-get\_reposts)
  - [async def get\_rid()](#async-def-get\_rid)
  - [async def is\_article()](#async-def-is\_article)
  - [async def is\_opus()](#async-def-is\_opus)
  - [async def markdown()](#async-def-markdown)
  - [async def remove\_top()](#async-def-remove\_top)
  - [async def repost()](#async-def-repost)
  - [async def set\_favorite()](#async-def-set\_favorite)
  - [async def set\_like()](#async-def-set\_like)
  - [async def set\_top()](#async-def-set\_top)
  - [async def turn\_to\_article()](#async-def-turn\_to\_article)
  - [def turn\_to\_opus()](#def-turn\_to\_opus)
- [class DynamicContentType()](#class-DynamicContentType)
- [class DynamicType()](#class-DynamicType)
- [class SendDynamicType()](#class-SendDynamicType)
- [async def delete\_schedule()](#async-def-delete\_schedule)
- [async def get\_dynamic\_page\_UPs\_info()](#async-def-get\_dynamic\_page\_UPs\_info)
- [async def get\_dynamic\_page\_info()](#async-def-get\_dynamic\_page\_info)
- [async def get\_dynamic\_page\_list()](#async-def-get\_dynamic\_page\_list)
- [async def get\_live\_users()](#async-def-get\_live\_users)
- [async def get\_new\_dynamic\_users()](#async-def-get\_new\_dynamic\_users)
- [async def get\_schedules\_list()](#async-def-get\_schedules\_list)
- [async def send\_dynamic()](#async-def-send\_dynamic)
- [async def send\_schedule\_now()](#async-def-send\_schedule\_now)
- [async def upload\_image()](#async-def-upload\_image)

---

## class BuildDynamic()

构建动态内容. 提供两种 API.

- 1. 链式调用构建

``` python
BuildDynamic.empty().add_plain_text("114514").add_image(await Picture.load_url("https://www.bilibili.com/favicon.ico"))
```

- 2. 参数构建

``` python
BuildDynamic.create_by_args(text="114514", topic_id=114514)
```




### def \_\_init\_\_()

构建动态内容




### def add_at()

添加@用户,支持传入 用户名或 UID


| name | type | description |
| - | - | - |
| `uid` | `int` | 用户ID |
| `uname` | `str` | 用户名称. Defaults to "". |




### def add_emoji()

添加表情


| name | type | description |
| - | - | - |
| `emoji` | `str` | 表情文字 |




### def add_image()

添加图片


| name | type | description |
| - | - | - |
| `image` | `Picture \| List[Picture]` | 图片类 |




### def add_plain_text()

添加纯文本


| name | type | description |
| - | - | - |
| `text` | `str` | 文本内容 |




### def add_text()

添加文本 (可包括 at, 表情包)


| name | type | description |
| - | - | - |
| `text` | `str` | 文本内容 |




### def add_vote()

添加投票


| name | type | description |
| - | - | - |
| `vote_id` | `int` | 投票对象 |




**@staticmethod** 

### def create_by_args()

通过参数构建动态


| name | type | description |
| - | - | - |
| `text` | `str, optional` | 动态文字. Defaults to "". |
| `pics` | `List[Picture]  , optional` | 动态图片列表. Defaults to []. |
| `topic_id` | `int, optional` | 动态话题 id. Defaults to -1. |
| `vote_id` | `int, optional` | 动态中的投票的 id. 将放在整个动态的最后面. Defaults to -1. |
| `live_reserve_id` | `int, optional` | 直播预约 oid. 通过 `live.create_live_reserve` 获取. Defaults to -1. |
| `send_time` | `datetime \| None, optional` | 发送时间. Defaults to None. |




**@staticmethod** 

### def empty()

新建空的动态以链式逐步构建






### def get_attach_card()

获取动态预约



**Returns:** `Optional[dict]`:  动态预约




### async def get_contents()

获取动态内容,通过请求完善字段后返回


| name | type | description |
| - | - | - |
| `credential` | `Credential` | 凭据类。必需。 |

**Returns:** `list`:  动态内容




### def get_dynamic_type()

获取动态类型



**Returns:** `SendDynamicType`:  动态类型




### def get_options()

获取动态选项



**Returns:** `dict`:  动态选项




### def get_pics()

获取动态图片



**Returns:** `list`:  动态图片




### def get_topic()

获取动态话题



**Returns:** `Optional[dict]`:  动态话题




### def set_attach_card()

设置直播预约

在 live.create_live_reserve 中获取 oid


| name | type | description |
| - | - | - |
| `oid` | `int` | 卡片oid |




### def set_options()

设置选项


| name | type | description |
| - | - | - |
| `up_choose_comment` | `bool` | 精选评论flag |
| `close_comment` | `bool` | 关闭评论flag |




### def set_send_time()

设置发送时间


| name | type | description |
| - | - | - |
| `time` | `datetime` | 发送时间 |




### def set_topic()

设置话题


| name | type | description |
| - | - | - |
| `topic_id` | `int` | 话题ID |




---

## class Dynamic()

动态类


| name | type | description |
| - | - | - |
| `credential` | `Credential` | 凭据类 |


### def \_\_init\_\_()


| name | type | description |
| - | - | - |
| `dynamic_id` | `int` | 动态 ID |
| `credential` | `Credential \| None, optional` | 凭据类. Defaults to None. |


### async def delete()

删除动态



**Returns:** `dict`:  调用 API 返回的结果




### def get_dynamic_id()

获取 动态 ID。



**Returns:** `int`:  动态 ID。




### async def get_info()

获取动态信息



**Returns:** `dict`:  调用 API 返回的结果




### async def get_likes()

获取动态点赞列表


| name | type | description |
| - | - | - |
| `pn` | `int, optional` | 页码,defaults to 1 |
| `ps` | `int, optional` | 每页大小,defaults to 30 |

**Returns:** `dict`:  调用 API 返回的结果




### async def get_lottery_info()

获取动态抽奖信息



**Returns:** `dict`:  调用 API 返回的结果




### async def get_reaction()

获取点赞、转发


| name | type | description |
| - | - | - |
| `offset` | `str, optional` | 偏移值(下一页的第一个动态 ID,为该请求结果中的 offset 键对应的值),类似单向链表. Defaults to "" |

**Returns:** `dict`:  调用 API 返回的结果




### async def get_reposts()

获取动态转发列表


| name | type | description |
| - | - | - |
| `offset` | `str, optional` | 偏移值(下一页的第一个动态 ID,为该请求结果中的 offset 键对应的值),类似单向链表. Defaults to "0" |

**Returns:** `dict`:  调用 API 返回的结果




### async def get_rid()

获取 rid,以传入 `comment.get_comments_lazy` 等函数 oid 参数对评论区进行操作



**Returns:** `int`:  rid




### async def is_article()

判断动态是否为专栏发布动态(评论、点赞等数据专栏/动态/图文共享)



**Returns:** `bool`:  是否为专栏




### async def is_opus()

判断动态是否为图文

如果是图文,则动态/图文评论/点赞/转发数据共享



**Returns:** `bool`:  是否为图文




### async def markdown()

生成动态富文本对应 markdown



**Returns:** `str`:  markdown




### async def remove_top()

取消置顶动态



**Returns:** `dict`:  调用 API 返回的结果




### async def repost()

转发动态


| name | type | description |
| - | - | - |
| `text` | `str, optional` | 转发动态时的文本内容. Defaults to "转发动态" |

**Returns:** `dict`:  调用 API 返回的结果




### async def set_favorite()

设置动态(图文)收藏状态


| name | type | description |
| - | - | - |
| `status` | `bool, optional` | 收藏状态. Defaults to True |

**Returns:** `dict`:  调用 API 返回的结果




### async def set_like()

设置动态点赞状态


| name | type | description |
| - | - | - |
| `status` | `bool, optional` | 点赞状态. Defaults to True. |

**Returns:** `dict`:  调用 API 返回的结果




### async def set_top()

置顶动态



**Returns:** `dict`:  调用 API 返回的结果




### async def turn_to_article()

将专栏发布动态转为对应专栏(评论、点赞等数据专栏/动态/图文共享)

如动态无对应专栏将报错。

转换后可投币。



**Returns:** `Article`:  专栏实例




### def turn_to_opus()

对图文动态,转换为图文

此函数不会核验动态是否为图文



**Returns:** `Opus`:  图文对象




---

## class DynamicContentType()

**Extend: enum.Enum**

动态内容类型

+ TEXT: 文本
+ EMOJI: 表情
+ AT: @User
+ VOTE: 投票




---

## class DynamicType()

**Extend: enum.Enum**

动态类型

+ ALL: 所有动态
+ ANIME: 追番追剧
+ ARTICLE: 文章
+ VIDEO: 视频投稿




---

## class SendDynamicType()

**Extend: enum.Enum**

发送动态类型
scene 参数

+ TEXT: 纯文本
+ IMAGE: 图片




---

## async def delete_schedule()

删除定时动态


| name | type | description |
| - | - | - |
| `draft_id` | `int` | 定时动态 ID |
| `credential` | `Credential` | 凭据 |

**Returns:** `dict`:  调用 API 返回的结果




---

## async def get_dynamic_page_UPs_info()

获取动态页 UP 主列表


| name | type | description |
| - | - | - |
| `credential` | `Credential` | 凭据类. |

**Returns:** `dict`:  调用 API 返回的结果




---

## async def get_dynamic_page_info()

获取动态页动态信息

获取全部动态或者相应类型需传入 _type

获取指定 UP 主动态需传入 host_mid


| name | type | description |
| - | - | - |
| `credential` | `Credential` | 凭据类. |
| `_type` | `DynamicType, optional` | 动态类型. Defaults to DynamicType.ALL. |
| `host_mid` | `int, optional` | 获取对应 UP 主动态的 mid. Defaults to None. |
| `features` | `str, optional` | 默认 itemOpusStyle. |
| `pn` | `int, optional` | 页码. Defaults to 1. |
| `offset` | `int, optional` | 偏移值(下一页的第一个动态 ID,为该请求结果中的 offset 键对应的值),类似单向链表. Defaults to None. |

**Returns:** `dict`:  调用 API 返回的结果




---

## async def get_dynamic_page_list()

获取动态页动态列表

获取全部动态或者相应类型需传入 _type

获取指定 UP 主动态需传入 host_mid


| name | type | description |
| - | - | - |
| `credential` | `Credential` | 凭据类. |
| `_type` | `DynamicType, optional` | 动态类型. Defaults to DynamicType.ALL. |
| `host_mid` | `int, optional` | 获取对应 UP 主动态的 mid. Defaults to None. |
| `features` | `str, optional` | 默认 itemOpusStyle. |
| `pn` | `int, optional` | 页码. Defaults to 1. |
| `offset` | `int, optional` | 偏移值(下一页的第一个动态 ID,为该请求结果中的 offset 键对应的值),类似单向链表. Defaults to None. |

**Returns:** `list[Dynamic]`:  动态类列表




---

## async def get_live_users()

获取正在直播的关注者


| name | type | description |
| - | - | - |
| `size` | `int` | 获取的数据数量. Defaults to 10. |
| `credential` | `Credential \| None` | 凭据类. Defaults to None. |

**Returns:** `dict`:  调用 API 返回的结果




---

## async def get_new_dynamic_users()

获取更新动态的关注者


| name | type | description |
| - | - | - |
| `credential` | `Credential \| None` | 凭据类. Defaults to None. |

**Returns:** `dict`:  调用 API 返回的结果




---

## async def get_schedules_list()

获取待发送定时动态列表


| name | type | description |
| - | - | - |
| `credential` | `Credential` | 凭据 |

**Returns:** `dict`:  调用 API 返回的结果




---

## async def send_dynamic()

发送动态


| name | type | description |
| - | - | - |
| `info` | `BuildDynamic` | 动态内容 |
| `credential` | `Credential` | 凭据 |

**Returns:** `dict`:  调用 API 返回的结果




---

## async def send_schedule_now()

立即发送定时动态


| name | type | description |
| - | - | - |
| `draft_id` | `int` | 定时动态 ID |
| `credential` | `Credential` | 凭据 |

**Returns:** `dict`:  调用 API 返回的结果




---

## async def upload_image()

上传动态图片


| name | type | description |
| - | - | - |
| `image` | `Picture` | 图片流. 有格式要求. |
| `credential` | `Credential` | 凭据 |
| `data` | `Dict` | 自定义请求体 |

**Returns:** `dict`:  调用 API 返回的结果




reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 319kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 319kUpdated Claude CodeCodexVerifiedInstall