← 返回 Skills 市场
guige821

bilibili-subtitle-analysis

作者 guige821 · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ⚠ suspicious
169
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install bilibili-subtitle-analysis
功能描述
B站字幕下载分析工具,基于 biliSub 项目。 支持:下载字幕、批量下载、内容分析、内容分析报告。 触发条件:用户要求下载B站字幕、分析字幕内容、生成内容报告。
使用说明 (SKILL.md)

Bilibili 字幕下载分析 Skill

基于 biliSub 项目实现。

功能

1. 字幕下载

  • 单个视频字幕下载(官方字幕)
  • 自动语音识别(ASR)生成字幕
  • 支持多种格式:JSON, TXT, SRT, ASS, VTT

2. 内容分析

  • 基础统计:行数、字符数、平均行长、时间戳数量、视频时长
  • 词频分析:中文高频词 TOP 30、英文高频词 TOP 30
  • 双词组分析:bigrams TOP 20
  • 情感分析:正面/负面/中性判断,情感得分
  • 关键词提取:中英文关键词 TOP 10
  • 文本密度:有效文本行占比

3. 详细总结报告(默认行为)

下载字幕后自动整理成详细的中文总结报告,包含:

  • 视频概览:标题、时长、主题分类
  • 核心内容:分段总结,主要观点提炼
  • 关键引用:重要或精彩的原句摘录
  • 结构化分析:分类整理(技术点、案例、观点等)
  • 一句话点评:总结性评价

报告格式示例:

## 📺 视频总结:[视频标题]

**视频来源**:[BV号]
**视频时长**:X分钟
**主要内容**:一句话描述

---

### 🎮 核心内容
[分段详细总结,每段包含要点和原句]

### 💡 关键引用
- "摘录的精彩原句"

### 📊 结构化分析
| 类别 | 内容 |
|------|------|
| 分类1 | 要点 |

### 🎯 一句话点评
[总结评价]

使用方式

下载字幕

node index.js download \x3C视频URL> [--formats json,txt] [--use-asr] [--asr-model small]

分析字幕

node index.js analyze \x3C字幕文件路径>

批量下载

node index.js batch \x3CURL列表文件路径>

设置 biliSub 路径

node index.js setpath \x3C本地路径>

Node.js API

const BilibiliSubtitleAnalyzer = require('./index.js');

const analyzer = new BilibiliSubtitleAnalyzer({
  outputDir: './output',
  biliSubPath: 'C:\\Users\\lml\\biliSub',
  proxy: 'http://127.0.0.1:7890'
});

// 下载字幕
const files = await analyzer.downloadSubtitle('BV1xx411c79H', {
  formats: ['json', 'txt'],
  useAsr: true,
  asrModel: 'small'
});

// 分析字幕
const result = analyzer.analyzeContent('./output/BV1xx411c79H.json');

// 生成报告
const report = analyzer.generateReport(result, 'BV1xx411c79H');
console.log(report);

报告示例

╔══════════════════════════════════════════════════════════════════════╗
║                    📺 B站字幕内容分析报告                              ║
╚══════════════════════════════════════════════════════════════════════╝

🎬 视频信息: BV1xx411c79H

📊 字幕基础统计
───────────────────────────────────────────────────────────────────────
  • 总行数: 1250
  • 字符数(去空格): 45000
  • 平均行长: 36.0 字符/行
  • 时间戳数量: 1250
  • 视频时长: 00:45:30

🔤 高频词 TOP 15(中)
  1. 你好: 45
  2. 我们: 38
  ...

💭 情感分析
  • 情感倾向: 🟡 中性
  • 情感得分: +5

安装依赖

# 克隆 biliSub 项目(MIT 许可证)
git clone https://github.com/lvusyy/biliSub

# 安装 Python 依赖
pip install -r requirements.txt

# 安装 bilibili-api
pip install bilibili-api-python==17.1.2

# 可选:安装 whisper(用于 ASR)
pip install openai-whisper

许可证声明

本技能基于 MIT 许可证开源的 biliSub 项目构建。 详细许可证声明请查看 LICENSE 文件。

注意事项

  1. 使用 ASR 功能需要安装 ffmpeg
  2. 批量下载时注意控制并发(默认 3)
  3. 长视频处理可能需要较长时间(尤其 ASR)
安全使用建议
This skill's core functionality (downloading/analyzing subtitles) appears plausible, but there are red flags you should consider before installing: - Do NOT share your Bilibili cookie or any login credentials with the skill author or any external service. The README explicitly says to '复制发给openclaw' (copy and send the cookie to openclaw) — that is unnecessary and dangerous. A cookie can allow account access and should remain local. - The package runs a third-party Python script (biliSub) and asks you to git clone and pip install dependencies. Only do this if you trust the biliSub repo and are comfortable running its code locally. - The shipped JS probes many filesystem locations (HOME, Downloads, Documents, .openclaw) to find a biliSub copy. If you are concerned about privacy, run the tool in a sandboxed environment or container where it cannot access your personal files. - Prefer configuring any required cookie or credentials locally (e.g., set them in a local file or environment variable on your machine) rather than sending them to the skill author or platform. Ask the maintainer to provide explicit, local-only configuration instructions (e.g., set BILISUB_COOKIE or place a cookie file in the skill directory) instead of asking you to transmit secrets. - If you need stronger assurance, review the referenced enhanced_bilisub.py (and any pip-installed packages) before running, or use a throwaway Bilibili account with no personal data. Given the explicit instruction to externally transmit a login cookie and the code's filesystem probing, treat this skill as suspicious until the author clarifies how credentials are handled and removes any instruction to send cookies off-platform.
功能分析
Type: OpenClaw Skill Name: bilibili-subtitle-analysis Version: 1.0.3 The skill contains a critical shell injection vulnerability in `index.js` because it uses `execSync` to execute Python commands with unsanitized user input (video URLs) joined by spaces. It also performs broad, automated searches for the `biliSub` dependency across sensitive user locations, including the Home, Documents, and Downloads directories. While it requests Bilibili cookies and uses environment variables for configuration, these actions appear aligned with its stated purpose of subtitle analysis rather than intentional data exfiltration.
能力评估
Purpose & Capability
The skill's claimed purpose (download + analyze Bilibili subtitles) is consistent with the shipped code (index.js runs a Python biliSub script and performs text analysis). However the README/SKILL.md ask users to extract their B站 cookie and '发给openclaw' (send to openclaw), which is not reflected in declared requirements (no required env vars) and is unnecessary to document as external exfiltration. The code expects a local biliSub clone and may use cookies implicitly via the underlying Python script, but the instruction to send cookie data externally is disproportionate to the stated purpose.
Instruction Scope
SKILL.md/README instructs cloning biliSub, installing Python deps, and obtaining a Bilibili cookie via browser devtools. README explicitly tells users to '复制发给openclaw' (copy and send the cookie to openclaw), which directs sensitive credentials outside the user's environment. The runtime code (index.js) also scans various filesystem locations for a local 'biliSub' (including HOME, Downloads, Documents and a '.openclaw' path), reads environment variables broadly (process.env), and executes a Python script via child_process.execSync—behavior that goes beyond just parsing a single input file and can access user filesystem/environment context.
Install Mechanism
There is no formal install spec in the skill manifest, but SKILL.md instructs manual steps: git clone of an external GitHub repo and pip installs (including optional whisper/openai-whisper). Those are common for this kind of tool but require running arbitrary Python code from a third-party repo. No downloads from unknown shorteners are used, but the user is expected to run third-party code (biliSub) locally.
Credentials
The manifest declares no required environment variables or credentials, yet index.js reads and uses multiple env vars if present (BILI_OUTPUT_DIR, BILISUB_PATH, BILI_PYTHON_LIB, BILI_PROXY, BILI_PYTHON). README asks for a Bilibili login cookie and instructs sending it to the platform. Asking for a full login cookie (which can grant account access) and telling users to transmit it externally is a disproportionate and risky requirement for a subtitle downloader/analyzer.
Persistence & Privilege
The skill does not request 'always: true' and does not modify other skills. However it probes user directories (including a '.openclaw' folder and multiple home/downloads paths) to locate biliSub, which reads system state beyond the immediate working directory. This is not shown as a declared permission and could reveal the presence of files/folders on the host.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install bilibili-subtitle-analysis
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /bilibili-subtitle-analysis 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
# Bilibili 字幕下载分析 Skill 基于 [biliSub](https://github.com/lvusyy/biliSub) 项目 ## 功能 1. **字幕下载** - 下载 B 站视频官方字幕或 ASR 字幕 2. **内容分析** - 词频、情感、统计 3. **详细总结** - 生成结构化总结报告 ## 安装 ```bash # 安装 Python 依赖 pip install -r requirements.txt pip install bilibili-api-python==17.1.2 ``` ## B 站 Cookie 配置(重要!) 下载字幕需要 B 站登录凭证,请按以下步骤获取: ### 获取 Cookie 1. 登录 [bilibili.com](https://bilibili.com) 2. 按 `F12` 打开开发者工具 → 切换到 **Network** 标签 3. 左侧找到 **Cookies** → 选择 `bilibili.com` 4. 找到并复制发给openclaw ### 配置 Cookie ## 使用 直接发视频链接说使用技能bilibili-subtitle-analysis ```bash # 下载字幕 node index.js download "https://www.bilibili.com/video/BV1xx411c79H" # 分析字幕 node index.js analyze "./subtitle.json" # 生成详细总结 node index.js summary "./subtitle.json" # 一键下载+总结 node index.js full "https://www.bilibili.com/video/BV1xx411c79H" ``` ## 常见问题 ### Q: 字幕下载失败,提示 "Credential 未提供"? **A:** 需要配置 B 站 Cookie,见上方「B 站 Cookie 配置」 ### Q: 官方字幕为空或下载失败? **A:** 大部分视频都有官方字幕,如提示无字幕,可能需要: - 确认 Cookie 有效 - 或视频本身没有字幕 ### Q: ffmpeg 是什么?需要安装吗? **A:** ffmpeg 是 **可选** 的,用于 ASR 语音识别生成字幕。 - 普通下载字幕 **不需要** ffmpeg - 如需语音识别功能,请安装 [ffmpeg](https://ffmpeg.org/download.html) ## 目录结构 ``` skills/ ├── bilibili-subtitle-analysis/ ← 技能主目录 │ ├── index.js │ └── README.md └── biliSub/ ← 已内置 └── enhanced_bilisub.py ``` ## 许可证声明 本技能基于 MIT 许可证开源的 [biliSub](https://github.com/lvusyy/biliSub) 项目构建。 biliSub License: Copyright (c) 2024 lvsyy
v1.0.2
# Bilibili 字幕下载分析 Skill 基于 [biliSub](https://github.com/lvusyy/biliSub) 项目 ## 功能 1. **字幕下载** - 下载 B 站视频官方字幕或 ASR 字幕 2. **内容分析** - 词频、情感、统计 3. **详细总结** - 生成结构化总结报告 ## 安装 ```bash # 安装 Python 依赖 pip install -r requirements.txt pip install bilibili-api-python==17.1.2 ``` ## B 站 Cookie 配置(重要!) 下载字幕需要 B 站登录凭证,请按以下步骤获取: ### 获取 Cookie 1. 登录 [bilibili.com](https://bilibili.com) 2. 按 `F12` 打开开发者工具 → 切换到 **Application** 标签 3. 左侧找到 **Cookies** → 选择 `bilibili.com` 4. 找到并复制以下三个值: - `SESSDATA` - `bili_jct` - `buvid3` ### 配置 Cookie 设置环境变量(**二选一**): **方式A: 临时变量(每次终端需重新设置)** ```bash # Windows (PowerShell) $env:BILI_SESSDATA="你的SESSDATA值" $env:BILI_JCT="你的bili_jct值" $env:BILI_BUVID3="你的buvid3值" # macOS/Linux export BILI_SESSDATA="你的SESSDATA值" export BILI_JCT="你的bili_jct值" export BILI_BUVID3="你的buvid3值" ``` **方式B: 永久配置** ```bash # Windows - 编辑用户环境变量 # 添加系统变量 BILI_SESSDATA, BILI_JCT, BILI_BUVID3 ``` ## 使用 ```bash # 下载字幕 node index.js download "https://www.bilibili.com/video/BV1xx411c79H" # 分析字幕 node index.js analyze "./subtitle.json" # 生成详细总结 node index.js summary "./subtitle.json" # 一键下载+总结 node index.js full "https://www.bilibili.com/video/BV1xx411c79H" ``` ## 常见问题 ### Q: 字幕下载失败,提示 "Credential 未提供"? **A:** 需要配置 B 站 Cookie,见上方「B 站 Cookie 配置」 ### Q: 官方字幕为空或下载失败? **A:** 大部分视频都有官方字幕,如提示无字幕,可能需要: - 确认 Cookie 有效 - 或视频本身没有字幕 ### Q: ffmpeg 是什么?需要安装吗? **A:** ffmpeg 是 **可选** 的,用于 ASR 语音识别生成字幕。 - 普通下载字幕 **不需要** ffmpeg - 如需语音识别功能,请安装 [ffmpeg](https://ffmpeg.org/download.html) ## 目录结构 ``` skills/ ├── bilibili-subtitle-analysis/ ← 技能主目录 │ ├── index.js │ └── README.md └── biliSub/ ← 已内置 └── enhanced_bilisub.py ``` ## 许可证声明 本技能基于 MIT 许可证开源的 [biliSub](https://github.com/lvusyy/biliSub) 项目构建。 biliSub License: Copyright (c) 2024 lvsyy
v1.0.1
# Bilibili 字幕下载分析 Skill 基于 [biliSub](https://github.com/lvusyy/biliSub) 项目 ## 功能 1. **字幕下载** - 下载 B 站视频官方字幕或 ASR 字幕 2. **内容分析** - 词频、情感、统计 3. **详细总结** - 生成结构化总结报告 ## 安装 ```bash # 安装 Python 依赖(已在目录中的 biliSub) pip install -r requirements.txt pip install bilibili-api-python==17.1.2 ``` > 📁 **已内置**:biliSub 项目已内置在 `../biliSub/` 目录,自动找到无需配置! ## 使用 ```bash # 下载字幕 node index.js download "https://www.bilibili.com/video/BV1xx411c79H" # 分析字幕 node index.js analyze "./subtitle.json" # 生成详细总结 node index.js summary "./subtitle.json" # 一键下载+总结 node index.js full "https://www.bilibili.com/video/BV1xx411c79H" ``` ## 目录结构 ``` skills/ ├── bilibili-subtitle-analysis/ ← 技能主目录 │ ├── index.js │ ├── SKILL.md │ └── README.md └── biliSub/ ← 已内置,自动找到! ├── enhanced_bilisub.py └── requirements.txt ``` ## 自定义配置(可选) 如需自定义,可设置环境变量: | 环境变量 | 说明 | 默认值 | |---------|------|--------| | `BILISUB_PATH` | biliSub 项目路径 | 自动使用内置版本 | | `BILI_PYTHON` | Python 解释器 | python | | `BILI_OUTPUT_DIR` | 输出目录 | ./bilibili-output | ## 示例输出 ``` 📺 视频详细总结报告 **视频时长**:08:25 **字幕字数**:21,017 字符 📊 内容概览 • 字幕行数:246 行 • 情感倾向:中性 🔤 高频关键词 中文:游戏、引擎,开发、技术... 英文:Unity、AI、MCP... 📝 内容摘要 【第1段】Hello...游戏引擎 【第2段】很多玩家在玩游戏的时候... ``` ## 许可证声明 本技能基于 MIT 许可证开源的 [biliSub](https://github.com/lvusyy/biliSub) 项目构建。 biliSub License: Copyright (c) 2024 lvsyy(完整许可证见 biliSub 项目)
v1.0.0
bilibili-subtitle-analysis 1.0.0 - 首次发布:基于 biliSub 项目构建的 B站字幕下载及分析工具 - 支持下载单个视频字幕、批量下载、自动语音识别(ASR)生成字幕、多种字幕格式 - 提供字幕内容分析(基础统计、词频、双词组、情感分析、关键词、文本密度) - 自动生成详细的中文总结报告,包含视频概览、分段总结、结构化分析等 - 提供命令行和 Node.js API 调用方式
元数据
Slug bilibili-subtitle-analysis
版本 1.0.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

bilibili-subtitle-analysis 是什么?

B站字幕下载分析工具,基于 biliSub 项目。 支持:下载字幕、批量下载、内容分析、内容分析报告。 触发条件:用户要求下载B站字幕、分析字幕内容、生成内容报告。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 169 次。

如何安装 bilibili-subtitle-analysis?

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

bilibili-subtitle-analysis 是免费的吗?

是的,bilibili-subtitle-analysis 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

bilibili-subtitle-analysis 支持哪些平台?

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

谁开发了 bilibili-subtitle-analysis?

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

💬 留言讨论