← Back to Skills Marketplace
e421083458

Bilibili Player

by niuyufu · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
847
Downloads
0
Stars
4
Active Installs
1
Versions
Install in OpenClaw
/install bilibili-player
Description
B 站视频播放器。用 Playwright 搜索 B 站视频并获取准确链接,然后用 open 命令在当前浏览器打开播放。Use when users request to play Bilibili videos or search for specific content.
README (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 命令打开 → 浏览器播放

详细步骤

  1. Playwright 搜索 - 无头 Chromium 访问 B 站搜索页面
  2. 解析页面 - 提取第一个视频卡片的链接
  3. open 打开 - 用 macOS open 命令在默认浏览器打开
  4. 播放 - 用户在浏览器中观看(有声音、有登录状态)

脚本说明

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 封装
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install bilibili-player
  3. After installation, invoke the skill by name or use /bilibili-player
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug bilibili-player
Version 1.0.0
License
All-time Installs 4
Active Installs 4
Total Versions 1
Frequently Asked Questions

What is Bilibili Player?

B 站视频播放器。用 Playwright 搜索 B 站视频并获取准确链接,然后用 open 命令在当前浏览器打开播放。Use when users request to play Bilibili videos or search for specific content. It is an AI Agent Skill for Claude Code / OpenClaw, with 847 downloads so far.

How do I install Bilibili Player?

Run "/install bilibili-player" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Bilibili Player free?

Yes, Bilibili Player is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Bilibili Player support?

Bilibili Player is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Bilibili Player?

It is built and maintained by niuyufu (@e421083458); the current version is v1.0.0.

💬 Comments