dsh-plugin-bili-summary
DeepSeek Harness Host plugin: bili_summary tool — Bilibili video metadata, subtitle timeline and sharp-based frame cutting
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:YZz-S/dsh-bili-summary说明文档
阅读完整 README ↗bili-summary
DeepSeek Harness Host 插件:注册模型工具
bili_summary,一次调用取回 B站视频的元数据、字幕时间轴与可选配图素材(sharp 切帧),供 Agent 生成带时间点跳转链接的结构化总结笔记。
特性
- 一个工具走完全流程:
video输入支持 BV 号、bilibili.com/video/链接与b23.tv短链(自动解析跳转) - 字幕优先:AI 字幕/人工字幕时间轴 → SRT 缓存;字幕过长时写文件并只内联返回摘录,模型用
read分段阅读 - 可选配图(仅当用户明确要求"带图"):封面 + 每章代表帧,sharp 从播放器快照接口切出,本地存储、相对路径引用
- 错误处理是代码行为:B站错误码映射(-404/-412/-352/62002…)、超时、指数退避重试、风控自动重试,业务失败返回结构化 JSON 不抛异常
- 逐级降级:字幕 → 无字幕说明;切帧 → 仅封面 → 纯文字,每级失败原因都返回给模型
- 跨平台:纯 Node 实现(≥20.9),无 shell 调用、无编码坑;文件名清洗兼容 Windows 非法字符与保留名
- 多P视频:
page参数切换分P,每 P 独立 cid;越界给出总 P 数
安装(dsh.bundle)
本仓库同时是可安装的 dsh 插件包(package.json 声明 dsh.bundle,cordis.patch.yml 声明插入行):
dsh plugin --profile web add github:YZz-S/dsh-bili-summary
安装后以 dsh --profile web 启动即自动挂载 bili_summary 工具;headless 用户把 profile 换成 headless。注意:
dsh plugin内部转发给 pnpm(需先装 pnpm),首次会自动初始化 profile;- 若 pnpm 提示批准构建脚本,批准 sharp 可获得切帧能力;不批准也能安装,插件自动降级为"仅封面配图";
- 行级配置(outputDir / cookie 等)在 profile 自己的
cordis.patch.yml中按行 idbili-summary覆盖。
安装(agent preset 行)
- 准备一个自己的 DSH agent preset(用户 preset 位于
${DSH_HOME}/.agent-presets//,组合文件agent.cordis.yml)。 - 把
bili-summary.js放进 preset 目录,在组合里加一行:
- id: tool-bili-summary
name: ./bili-summary.js
config:
outputDir: bili-output
(完整示例见 examples/cordis.row.yml;该行只向宿主 tools 注册表注册工具、不发布服务,不需要 isolate realm。)
- sharp(可选):在插件目录树内执行
npm install。不装也能用——自动降级为"仅封面配图"并在结果里说明。 - 用
standingKeyFor( )挂载校验,然后开新会话确认工具列表出现bili_summary。
工具参数
| 参数 | 类型 | 说明 |
|---|---|---|