← 返回 Skills 市场
pcjinglang

Bilibili Analytics

作者 pcjinglang · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
906
总下载
0
收藏
7
当前安装
1
版本数
在 OpenClaw 中安装
/install bilibili-analytics
功能描述
Bilibili视频搜索与数据分析。抓取指定关键词的搜索结果,生成统计报告。支持多页面抓取、数据分析和可视化报告。适用于:(1) 搜索B站视频 (2) 分析视频数据 (3) 生成统计报告 (4) 追踪热门趋势
使用说明 (SKILL.md)

Bilibili Analytics

搜索和分析B站视频数据,生成统计报告。

快速开始

# 搜索关键词并抓取数据
agent-browser open "https://search.bilibili.com/all?keyword=你的关键词"

# 获取数据
agent-browser eval '抓取脚本'

# 生成报告
# 分析数据并输出统计

完整工作流程

1. 搜索视频

agent-browser open "https://search.bilibili.com/all?keyword={关键词}" --timeout 15000

2. 抓取数据

使用 scripts/scrape_videos.sh 或手动执行:

agent-browser eval '
const videos = [];
document.querySelectorAll(".bili-video-card").forEach((card) => {
  const title = card.querySelector(".bili-video-card__info--tit")?.textContent.trim() || "";
  const author = card.querySelector(".bili-video-card__info--author")?.textContent.trim() || "";
  const date = card.querySelector(".bili-video-card__info--date")?.textContent.trim() || "";
  const stats = card.querySelectorAll(".bili-video-card__stats--item");
  const playCount = stats[0]?.textContent.trim() || "0";
  const commentCount = stats[1]?.textContent.trim() || "0";
  videos.push({title, author, date, playCount, commentCount});
});
JSON.stringify(videos, null, 2);
'

3. 多页面抓取

# 翻页抓取
for page in 1 2 3 4 5; do
  agent-browser open "https://search.bilibili.com/all?keyword={关键词}&page=$page"
  agent-browser eval '抓取脚本' >> data.json
done

4. 数据分析

使用 scripts/analyze_data.py 或手动分析:

  • 时间分布统计
  • 作者活跃度排名
  • 评论数分布
  • 播放量分布
  • 关键发现和建议

脚本说明

scripts/scrape_videos.sh

一键抓取脚本,支持指定关键词和页数。

./scripts/scrape_videos.sh "关键词" 页数

scripts/analyze_data.py

数据分析脚本,生成统计报告。

python scripts/analyze_data.py data.json

输出格式

统计报告模板

## 📊 Bilibili "{关键词}" 搜索结果统计报告

### 📈 总体数据
- 数据范围: 前N页搜索结果
- 视频总数: X个
- 采集时间: YYYY-MM-DD HH:MM

### 🕐 发帖时间分布
| 时间段 | 数量 | 占比 |
|--------|------|------|

### 👥 活跃作者 TOP 10
| 排名 | 作者 | 视频数 |
|------|------|--------|

### 💬 评论数分布
| 评论数范围 | 视频数 | 占比 |
|------------|--------|------|

### 👁️ 播放量分布
| 播放量范围 | 视频数 | 占比 |
|------------|--------|------|

### 🎯 关键发现
1. ...
2. ...

### 📝 建议
- ...

注意事项

  1. 反爬虫: B站有反爬虫机制,建议控制抓取频率
  2. 数据准确性: 数据实时变化,报告仅代表抓取时刻状态
  3. 隐私合规: 仅抓取公开数据,不涉及用户隐私

错误处理

  • 浏览器启动失败:检查 agent-browser 安装
  • 数据抓取失败:检查页面是否加载完成
  • 分析脚本错误:检查数据格式是否正确
安全使用建议
This skill appears to be what it claims (scrape Bilibili search results and analyze them), but check these before installing or running: - Missing declared dependencies: the scripts and SKILL.md require agent-browser (a third-party CLI) and the shell script prints usage of `jq`—these are not listed in the registry metadata. Install and vet agent-browser separately before use. - Origin & provenance: the package homepage and source are unknown/placeholder; prefer skills from a known repository or inspect the full code locally before running. - Rate limits and legality: scraping public pages is visible to the target site and may violate terms of service; use conservative scraping rates and confirm compliance. - Requirements file mismatch: INSTALL.md references requirements.txt (pip) but the manifest doesn't include it—verify Python deps before running analyze_data.py. - Run in a restricted environment: because the skill opens web pages and writes files, run initially in a sandbox or isolated account and inspect outputs (JSON/report files). If you allow the agent to invoke this autonomously, be aware it can run multi-page scrapes automatically—consider limiting invocation or requiring manual approval. If you want to proceed, obtain and inspect the real upstream repository (or request the author/homepage), ensure agent-browser and jq are trusted and installed, and test on a small page set first.
功能分析
Type: OpenClaw Skill Name: bilibili-analytics Version: 1.0.0 The skill bundle is designed for legitimate Bilibili data analysis. However, the `scripts/scrape_videos.sh` file contains a shell injection vulnerability. The `KEYWORD` argument is directly embedded into the `agent-browser open "$URL"` command without proper sanitization, allowing an attacker to inject arbitrary shell commands if they can control the `KEYWORD` input. This is a critical vulnerability, but there is no clear evidence of intentional malicious behavior by the skill developer, thus classifying it as suspicious rather than malicious.
能力评估
Purpose & Capability
The name/description (Bilibili scraping + analysis) align with the included scripts and SKILL.md. However the package metadata lists no required binaries while both SKILL.md, INSTALL.md, and scripts clearly require the external tool `agent-browser` (and the scrape script also expects `jq` for the final count). This is an omission/incoherence in declared requirements.
Instruction Scope
Runtime instructions and scripts limit activity to opening Bilibili search pages, executing browser-evaluation JavaScript to extract public page data, saving JSON files, and running a local Python analysis. The instructions do not reference unrelated system files, environment secrets, or external endpoints beyond Bilibili and local filesystem. They do instruct multi-page scraping and use sleep to slow requests, but they give the agent discretion to perform repeated requests—so rate limits and anti-scraping behavior should be considered.
Install Mechanism
There is no formal install spec in the registry (instruction-only), which is lower-risk; INSTALL.md provides manual install steps including downloading/unzipping or git cloning. No external binary downloads from untrusted URLs are present in included files. Still, the INSTALL.md asks the user to run `agent-browser install` and to pip-install requirements (requirements.txt is referenced but not present in the file manifest), which are operational gaps to verify.
Credentials
The skill declares no environment variables or credentials and the scripts do not attempt to read secrets. The requests and filesystem writes (creating bilibili_data_*.json and report files) are proportional to the stated data-collection purpose.
Persistence & Privilege
The skill does not request always:true, does not modify other skills, and only writes output files in the working directory. It runs on-demand via agent-browser and local scripts; no elevated or persistent platform-level privileges are requested.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install bilibili-analytics
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /bilibili-analytics 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
首个版本:B站视频搜索与数据分析
元数据
Slug bilibili-analytics
版本 1.0.0
许可证
累计安装 7
当前安装数 7
历史版本数 1
常见问题

Bilibili Analytics 是什么?

Bilibili视频搜索与数据分析。抓取指定关键词的搜索结果,生成统计报告。支持多页面抓取、数据分析和可视化报告。适用于:(1) 搜索B站视频 (2) 分析视频数据 (3) 生成统计报告 (4) 追踪热门趋势. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 906 次。

如何安装 Bilibili Analytics?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install bilibili-analytics」即可一键安装,无需额外配置。

Bilibili Analytics 是免费的吗?

是的,Bilibili Analytics 完全免费(开源免费),可自由下载、安装和使用。

Bilibili Analytics 支持哪些平台?

Bilibili Analytics 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Bilibili Analytics?

由 pcjinglang(@pcjinglang)开发并维护,当前版本 v1.0.0。

💬 留言讨论