← 返回 Skills 市场
686
总下载
0
收藏
4
当前安装
1
版本数
在 OpenClaw 中安装
/install bilibili-skill
功能描述
B 站 (Bilibili) CLI 工具 - 发布动态、管理视频、搜索内容、获取弹幕
使用说明 (SKILL.md)
Bilibili Skill for OpenClaw
📺 让 AI Agent 控制 B 站!支持发布动态、管理视频、搜索内容、获取弹幕等。
🚀 快速开始
安装依赖
pip3 install bilibili-api-python click Pillow pycryptodome beautifulsoup4 brotli qrcode apscheduler --break-system-packages
配置认证
在调用命令时提供 Cookies:
bilibili-cli.py \
--sessdata "你的 SESSDATA" \
--bili_jct "你的 bili_jct" \
--buvid3 "你的 buvid3" \
dynamic publish --content "Hello B 站!"
或者将 Cookies 保存到文件:
# Cookies 已保存在 /root/.openclaw/workspace/bilibili-cookies.md
📋 可用命令
动态操作
发布原创动态:
bilibili-cli.py \
--sessdata "$SESSDATA" --bili_jct "$BILI_JCT" --buvid3 "$BUVID3" \
dynamic publish --content "动态内容" --img /path/to/image.jpg
删除动态:
bilibili-cli.py \
--sessdata "$SESSDATA" --bili_jct "$BILI_JCT" \
dynamic delete --dyn-id 1179226104862343192
转发动态:
bilibili-cli.py \
--sessdata "$SESSDATA" --bili_jct "$BILI_JCT" \
dynamic repost --dyn-id 123456 --content "转发评论"
视频操作
获取视频信息:
bilibili-cli.py video info --bvid BV1uv411q7Mv --json-output
获取视频统计:
bilibili-cli.py video stats --bvid BV1uv411q7Mv
点赞视频:
bilibili-cli.py \
--sessdata "$SESSDATA" --bili_jct "$BILI_JCT" \
video like --bvid BV1uv411q7Mv --status true
用户操作
获取用户信息:
bilibili-cli.py user info --uid 3706946142079013 --json-output
获取用户投稿:
bilibili-cli.py user videos --uid 3706946142079013 --ps 10
搜索操作
搜索视频:
bilibili-cli.py search video --keyword "Python 教程" --page 1 --json-output
搜索用户:
bilibili-cli.py search user --keyword "老番茄" --json-output
直播操作
获取直播间信息:
bilibili-cli.py live info --room-id 22708562 --json-output
🤖 AI Agent 集成
OpenClaw MCP 配置
在 ~/.openclaw/openclaw.json 中添加:
{
"mcp": {
"servers": {
"bilibili": {
"command": "python3",
"args": ["/root/.openclaw/workspace/external/bilibili-mcp-server/bilibili.py"],
"transport": "stdio"
}
}
}
}
环境变量方式
export BILIBILI_SESSDATA="0bc2bad7%2C1788944530%2Ce3acf%2A31..."
export BILIBILI_BILI_JCT="94c0e8c198bc26f5c58c11490bd8ef62"
export BILIBILI_BUVID3="BEDF1095-927E-9F61-3920-7364E75F194027291infoc"
然后在命令中使用:
bilibili-cli.py \
--sessdata "$BILIBILI_SESSDATA" \
--bili_jct "$BILIBILI_BILI_JCT" \
--buvid3 "$BILIBILI_BUVID3" \
dynamic publish --content "Hello!"
📊 功能对比
| 功能 | MCP Server | CLI 工具 |
|---|---|---|
| 搜索内容 | ✅ | ✅ |
| 用户查询 | ✅ | ✅ |
| 视频详情 | ❌ | ✅ |
| 发布动态 | ❌ | ✅ |
| 删除动态 | ❌ | ✅ |
| 获取弹幕 | ✅ | ❌ |
| 点赞视频 | ❌ | ✅ |
| 直播查询 | ❌ | ✅ |
推荐: 两者结合使用!
- MCP Server 用于搜索/查询(AI 自然调用)
- CLI 工具用于发布/删除(脚本化操作)
🔧 高级用法
批量发布动态
#!/usr/bin/env python3
import subprocess
import time
cookies = "--sessdata 'xxx' --bili_jct 'xxx' --buvid3 'xxx'"
contents = [
"第一条动态",
"第二条动态",
"第三条动态"
]
for content in contents:
cmd = f"bilibili-cli.py {cookies} dynamic publish --content '{content}'"
subprocess.run(cmd, shell=True)
time.sleep(3) # 避免风控
获取视频弹幕(通过 MCP)
from mcp import Client
from bilibili import get_video_danmaku
danmaku = get_video_danmaku("BV1uv411q7Mv")
print(danmaku)
⚠️ 注意事项
- 速率限制: 避免快速连续调用(建议间隔 2-3 秒)
- 风控策略: 大量操作可能需要代理
- Cookie 有效期: SESSDATA 会过期,需定期更新
- 合法使用: 仅用于学习和测试,禁止滥用
📚 相关资源
- bilibili-api: https://github.com/Nemo2011/bilibili-api
- B 站 MCP Server: https://github.com/huccihuang/bilibili-mcp-server
- CLI-Anything: https://github.com/HKUDS/CLI-Anything
- Cookies 配置:
/root/.openclaw/workspace/bilibili-cookies.md
🎯 使用示例
示例 1: 发布 Ollama 推荐动态
bilibili-cli.py \
--sessdata "$SESSDATA" --bili_jct "$BILI_JCT" --buvid3 "$BUVID3" \
dynamic publish --content "🦙 Ollama:让大模型在你本地电脑运行!
2026 年了还在把数据发给云端 AI?Ollama 让你一键运行 Llama、Mistral 等大模型!
✅ 完全免费 ✅ 隐私安全 ✅ 离线可用
安装超简单:
curl -fsSL https://ollama.com/install.sh | sh
ollama run llama3.2
5 分钟就有自己的私有 AI 助手!🎉
#Ollama #AI #大语言模型 #开源 #本地 AI"
示例 2: 搜索 UP 主
bilibili-cli.py search user --keyword "老番茄" --json-output
输出:
{
"result": [
{
"uname": "老番茄",
"mid": 546195,
"fans": 2500000,
"videos": 500,
"level": 6
}
]
}
示例 3: 获取视频信息
bilibili-cli.py video info --bvid BV1uv411q7Mv
输出:
标题:爆肝 98 小时!在 MC 中还原糖调小镇
UP 主:糖调
播放:1234567
点赞:98765
时长:3600 秒
Skill 版本: 1.0.0 最后更新: 2026-03-13 维护者: 小爪 🐾
安全使用建议
This skill appears to be a legitimate Bilibili CLI wrapper, but it has important mismatches and risky recommendations you should review before installing. Key points: (1) It requires sensitive Bilibili cookies (SESSDATA, bili_jct, buvid3) even though the registry metadata doesn't declare them — do not store these in plaintext under the shared workspace unless you accept the risk. (2) The README instructs adding an MCP server entry to your ~/.openclaw/openclaw.json that points to an external script in the workspace — that lets the agent run that code and increases risk; only add this if you trust the source and have inspected the referenced code. (3) Avoid running ambiguous installer commands (the docs mention pip with --break-system-packages and example use of curl | sh in a posted message); install dependencies from trusted sources and avoid --break-system-packages. (4) Review the bilibili-cli implementation you will invoke (the skill expects /root/.openclaw/workspace/external/bilibili-api/bilibili-cli.py) — ensure it's the authentic project and inspect it for unexpected network endpoints or telemetry. (5) If you proceed, keep cookies in a secure secrets store or environment scoped to the process, not an unencrypted workspace file, and consider manual, minimal configuration rather than auto-adding MCP servers. If you want higher confidence, ask the maintainer for a provenance link to the exact bilibili-cli they expect and for the skill manifest to be updated to declare the required env vars.
功能分析
Type: OpenClaw Skill
Name: bilibili-skill
Version: 1.0.0
The skill bundle provides a legitimate integration for interacting with Bilibili via a CLI wrapper and an AI agent. It handles sensitive authentication tokens (SESSDATA, bili_jct) by reading them from environment variables or a local configuration file (`bilibili-cookies.md`), which is standard for such tools. The documentation (`README.md`, `SKILL.md`) includes clear risk warnings regarding account security and API rate limits. While `SKILL.md` contains a `curl | sh` command within a code block, it is explicitly presented as a sample string for a social media post (promoting Ollama) rather than an instruction for the agent to execute on the host system. The logic in `bilibili-wrapper.sh` is straightforward and lacks indicators of malicious intent or data exfiltration.
能力评估
Purpose & Capability
The skill's functionality (posting, deleting, searching on Bilibili) coherently requires Bilibili authentication and a CLI client; however the registry metadata lists no required environment variables or credentials while the SKILL.md and wrapper script clearly depend on SESSDATA / bili_jct / buvid3 (via env vars or a cookies file). This discrepancy between stated requirements and actual needs is incoherent and could mislead users about what secrets will be used.
Instruction Scope
Runtime instructions and examples tell the agent/user to store and read cookies from a workspace file (/root/.openclaw/workspace/bilibili-cookies.md) or environment variables, to add an MCP server entry to ~/.openclaw/openclaw.json (modifying agent configuration), and include an example using subprocess.run(..., shell=True) for batch publishing. These steps cause the agent (or a user) to read and persist sensitive credentials and to wire an external MCP server into the agent — actions beyond simple CLI invocation and worth vetting.
Install Mechanism
The skill is instruction-only (no automated install), which is low-risk, but the README/SKILL.md recommend pip installing multiple packages (including bilibili-api-python and others) and use of --break-system-packages. The recommended installs are from PyPI (expected) but the --break-system-packages flag is unusual and risky. No downloads from arbitrary URLs are programmed by the skill itself.
Credentials
Although registry metadata lists no required env vars, the wrapper script and documentation require BILIBILI_SESSDATA, BILIBILI_BILI_JCT, and BILIBILI_BUVID3 (or a cookies file). Asking for three account cookies/keys is proportionate to the stated capability, but the fact they are not declared in the skill manifest and the recommended storage is an unencrypted workspace file increases risk of accidental credential exposure.
Persistence & Privilege
The SKILL.md instructs adding a new MCP server entry to ~/.openclaw/openclaw.json pointing at an external script inside the workspace. That change would cause the agent to load/run external code via stdio transport. While the skill is not marked always:true, advising or automating modification of agent configuration to add an external MCP server expands the attack surface and should be treated with care.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install bilibili-skill - 安装完成后,直接呼叫该 Skill 的名称或使用
/bilibili-skill触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
📺 初始版本 - AI Agent 控制 B 站
✅ 功能:
- 动态发布/删除/转发
- 视频/用户查询
- 搜索功能
- 直播查询
- MCP Server 集成
⚠️ 警告:
- 可能触发风控导致账号限制
- 使用需谨慎,建议仅用于学习/测试
🔗 GitHub: https://github.com/OSSKn4w7/bilibili-skill
元数据
常见问题
📺 Bilibili Skill 是什么?
B 站 (Bilibili) CLI 工具 - 发布动态、管理视频、搜索内容、获取弹幕. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 686 次。
如何安装 📺 Bilibili Skill?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install bilibili-skill」即可一键安装,无需额外配置。
📺 Bilibili Skill 是免费的吗?
是的,📺 Bilibili Skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
📺 Bilibili Skill 支持哪些平台?
📺 Bilibili Skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 📺 Bilibili Skill?
由 OSSKn4w7(@osskn4w7)开发并维护,当前版本 v1.0.0。
推荐 Skills