← 返回 Skills 市场
847
总下载
0
收藏
4
当前安装
1
版本数
在 OpenClaw 中安装
/install bilibili-player
功能描述
B 站视频播放器。用 Playwright 搜索 B 站视频并获取准确链接,然后用 open 命令在当前浏览器打开播放。Use when users request to play Bilibili videos or search for specific content.
使用说明 (SKILL.md)
B 站视频播放器
功能
用 Playwright 无头浏览器搜索 B 站视频,获取准确链接后用系统 open 命令在用户当前浏览器打开播放。
使用场景
- 播放电影/电视剧(如:三国演义、电影名称)
- 播放音乐/MV(如:伍佰 突然的自我)
- 播放纪录片/教程
- 任何需要在 B 站搜索并播放视频的场景
优势
- ✅ 准确 - Playwright 直接解析页面获取视频链接
- ✅ 快速 - 无头模式搜索,不阻塞用户界面
- ✅ 稳定 - 用用户浏览器播放,有音频、有登录状态、有 Cookie
- ✅ 简单 - 一个命令完成搜索 + 打开
使用方法
基本用法
bilibili-player.sh "搜索关键词"
示例
# 播放电视剧
bilibili-player.sh "三国演义 1994 火烧赤壁"
bilibili-player.sh "西游记 央视版"
# 播放音乐
bilibili-player.sh "伍佰 突然的自我"
bilibili-player.sh "李宇春 蜀绣"
# 播放电影
bilibili-player.sh "流浪地球"
工作流程
用户请求 → Playwright 搜索 → 提取视频链接 → open 命令打开 → 浏览器播放
详细步骤
- Playwright 搜索 - 无头 Chromium 访问 B 站搜索页面
- 解析页面 - 提取第一个视频卡片的链接
- open 打开 - 用 macOS open 命令在默认浏览器打开
- 播放 - 用户在浏览器中观看(有声音、有登录状态)
脚本说明
bilibili-player.py
Python 脚本,执行搜索和打开操作。
依赖:
- Python 3
- Playwright (
pip3 install playwright)
用法:
python3 bilibili-player.py "搜索关键词"
bilibili-player.sh
Shell 封装脚本,方便直接调用。
用法:
./bilibili-player.sh "搜索关键词"
技术细节
Playwright 选择器
脚本使用以下选择器查找视频链接(按优先级):
selectors = [
"a[href*='/video/']", # 最准确:包含/video/的链接
".bili-video-card a", # 备选:视频卡片的链接
]
链接处理
- 相对链接自动补全为完整 URL
- 支持
//开头的协议相对链接
错误处理
- 如果找不到视频,打开搜索页面
- 超时时间:60 秒
- 等待页面加载:3 秒
限制
- 仅支持 macOS(依赖 open 命令)
- 需要安装 Playwright
- 需要网络连接
扩展建议
如需支持其他平台:
- Linux: 用
xdg-open替代open - Windows: 用
start替代open
相关文件
scripts/bilibili-player.py- 主脚本scripts/bilibili-player.sh- Shell 封装
安全使用建议
This skill appears coherent and limited to its stated purpose, but before running it: (1) ensure you install Playwright and its browser binaries (pip install playwright && playwright install) on the machine that will run the script; (2) note the scripts are macOS-focused (use xdg-open or start on Linux/Windows); (3) be aware the script will open whatever URL it finds in your default browser—only run it with trusted search terms and review the code if you want to confirm behavior; (4) consider URL-encoding search keywords to avoid malformed searches; (5) run in a user account/environment you control if you have concerns about automated browser activity.
功能分析
Type: OpenClaw Skill
Name: bilibili-player
Version: 1.0.0
The skill bundle uses `subprocess.run(['open', video_url])` in `scripts/bilibili-player.py` to open URLs. While the script's stated purpose is to open Bilibili video links (which are `https://` URLs), the `open` command on macOS is a powerful utility capable of opening arbitrary files or URLs, including local files (`file://`) or other potentially malicious schemes. Although the script constructs `video_url` from Bilibili search results, this broad capability, even when used with `subprocess.run` in a shell-injection-safe manner, presents a vulnerability risk if the `video_url` could be manipulated by an external factor (e.g., compromised search results) to point to sensitive local files or other unintended resources. This constitutes a 'risky capability' without clear malicious intent, classifying it as suspicious rather than benign.
能力评估
Purpose & Capability
Name/description match the implementation: the scripts perform a Bilibili search with Playwright and open the result in the system browser. There are no unrelated environment variables, binaries, or services requested.
Instruction Scope
SKILL.md and the scripts stick to the stated task (search + open). One minor implementation detail: the keyword is interpolated into the search URL without URL-encoding, which can lead to malformed searches for special characters (functional bug, not evidence of exfiltration). The instructions do not read or transmit other system files or credentials.
Install Mechanism
There is no automated install spec (instruction-only). The README notes Playwright must be installed via pip; Playwright also requires downloaded browser binaries (playwright install) which the skill does not automate. This is expected but worth noting: running the script requires the user to install Playwright and the browsers manually.
Credentials
The skill requires no environment variables or secrets and the code does not access credentials or config paths. Network activity is limited to Bilibili search pages and opening resulting links in the user's browser.
Persistence & Privilege
The skill does not request permanent presence (always=false) and does not modify agent/system configurations. It simply runs the provided scripts when invoked.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install bilibili-player - 安装完成后,直接呼叫该 Skill 的名称或使用
/bilibili-player触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of bilibili-player: a tool for searching and playing Bilibili videos via Playwright and the open command on macOS.
- Supports movie, TV show, music, documentary, and tutorial searches using natural keywords.
- Ensures accurate video retrieval by parsing Bilibili search results directly.
- Automatically opens the found video in the user's current macOS browser with full login/cookie support.
- Includes Python and shell scripts for flexible command-line usage.
- Requires Python 3, Playwright, macOS, and network connection.
元数据
常见问题
Bilibili Player 是什么?
B 站视频播放器。用 Playwright 搜索 B 站视频并获取准确链接,然后用 open 命令在当前浏览器打开播放。Use when users request to play Bilibili videos or search for specific content. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 847 次。
如何安装 Bilibili Player?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install bilibili-player」即可一键安装,无需额外配置。
Bilibili Player 是免费的吗?
是的,Bilibili Player 完全免费(开源免费),可自由下载、安装和使用。
Bilibili Player 支持哪些平台?
Bilibili Player 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Bilibili Player?
由 niuyufu(@e421083458)开发并维护,当前版本 v1.0.0。
推荐 Skills