archibate/dotfiles-opencode / skills/bilibili-api
bilibili-api
FlaggedThis 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.
references/docs/examples/opus.md
View on GitHub# 示例:图文点赞/投币/收藏
注:图文此时可以理解为动态/专栏皮套,点赞/收藏靠动态一模一样的 API (所有图文都属于动态),投币靠专栏 API (专栏都是有对应的图文的)。因此只有图文是专栏的情况下才能投币。
``` python
from bilibili_api import opus, sync, Credential
OPUS_ID = 492064593401566298
async def main():
op = opus.Opus(
OPUS_ID,
credential=Credential(
sessdata="",
bili_jct="",
),
)
await op.set_like(True)
print("点赞成功。")
if await op.is_article():
await op.add_coins()
print("投币成功。")
await op.set_favorite(True)
print("收藏成功。")
sync(main())
```
# 示例:专栏转为 markdown
专栏都有对应的图文,而且专栏内容目前阶段只能通过解析 html 方式获得,而图文内容是以 REST API 进行传递的,二者经过模块处理后得出的 markdown 有略微不同,可自行对比选择更佳版本。
``` python
# 已知图文求专栏
from bilibili_api import opus, sync, Credential
OPUS_ID = 492064593401566298
async def main():
op = opus.Opus(OPUS_ID)
with open("opus.md", "w+") as file:
file.write(await op.markdown())
ar = await op.turn_to_article()
await ar.fetch_content()
with open("article.md", "w+") as file:
file.write(ar.markdown())
sync(main())
```
``` python
# 已知专栏求图文
from bilibili_api import article, sync, Credential
CVID = 9841312
async def main():
ar = article.Article(cvid=CVID)
await ar.fetch_content()
with open("article.md", "w+") as file:
file.write(ar.markdown())
op = await ar.turn_to_opus()
with open("opus.md", "w+") as file:
file.write(await op.markdown())
sync(main())
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 467k | Updated | Claude CodeCodex | Verified | Install |
| 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: 319k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |