Skip to content
dsh.fish
Bundle

xby-bilibili

用于哔哩哔哩API的MCP服务器,支持视频搜索、用户内容获取等多种操作,适用于哔哩哔哩内容管理和数据分析场景。

Source
xby-skill
License
MIT
Updated
Updated 2 days ago

Readme

# xby-bilibili

DeepSeek Harness (DSH) 的插件:哔哩哔哩API服务

用于哔哩哔哩API的MCP服务器,支持视频搜索、用户内容获取等多种操作,适用于哔哩哔哩内容管理和数据分析场景。

## 功能

- **set_xby_apikey** — 在聊天中设置 API 密钥(自动持久化,重启有效)
- **search_user** — 
搜索哔哩哔哩用户信息。

Args:
    keyword: 用户名关键词
    page: 页码,默认为1

Returns:
    包含用户搜索结果的字典数据

- **search_and_recommend_videos** — 
搜索并推荐相关视频,提供详细的推荐理由和总结

Args:
    keyword: 搜索关键词(如"AI")
    count: 推荐视频数量,默认15条

Returns:
    包含推荐视频和总结的字典

- **get_user_id_by_name** — 
通过用户名获取用户ID,支持精确搜索和详细信息返回

Args:
    username: 用户名
    return_details: 是否返回详细信息,默认False只返回用户ID

Returns:
    如果return_details=False: {"user_id": int} 或 {"error": str}
    如果return_details=True: {"users": list, "exact_match": bool} 或 {"error": str}

- **get_video_danmaku** — 
获取视频的弹幕数据。支持视频链接或BV号输入。

Args:
    video_input: 视频链接或BV号
                支持格式:
                - BV号: BV1iv8CzVE2w
                - 完整链接: https://www.bilibili.com/video/BV1iv8CzVE2w/?spm_id_from=333.1387.homepage.video_card.click
                - 短链接: bilibili.com/video/BV1iv8CzVE2w
    page: 分P页码,从0开始,默认为0(第一个分P)

Returns:
    包含弹幕数据和视频信息的字典

- **get_user_dynamics** — 
获取指定用户的最新动态

Args:
    username: 用户名(如"技术爬爬虾")
    count: 要获取的动态数量,默认10条

Returns:
    包含用户动态信息的字典

- **get_user_videos** — 
获取指定用户的最新投稿视频

Args:
    username: 用户名(如"技术爬爬虾")
    count: 要获取的视频数量,默认10条

Returns:
    包含用户投稿视频信息的字典

- **get_user_collections** — 
获取指定用户的合集信息

Args:
    username: 用户名(如"技术爬爬虾")

Returns:
    包含用户合集信息的字典

- **get_collection_videos** — 
获取指定用户合集中的视频列表

Args:
    username: 用户名(如"技术爬爬虾")
    collection_name: 合集名称,可选
    collection_id: 合集ID,可选
    count: 要获取的视频数量,默认10条

Returns:
    包含合集视频信息的字典

- **search_collection_by_keyword** — 
在指定用户的所有合集中搜索包含关键词的视频

Args:
    username: 用户名(如"技术爬爬虾")
    keyword: 搜索关键词(如"MCP"、"AI与大模型"等)
    count: 每个合集最多返回的视频数量,默认10条

Returns:
    包含搜索结果的字典


## 安装

### 方式一:从 GitHub 直接安装(推荐)

```bash
# 格式: dsh plugin --profile <profile> add github:<owner>/<repo>
dsh plugin --profile web add github:xby_skill/xby-bilibili
```

### 方式二:从本地目录安装(开发模式)

```bash
# 仅用于本地开发调试
dsh plugin --profile web add /absolute/path/to/xby-bilibili
```

### 方式三:通过 cordis.patch.yml 开发调试

```bash
dsh web --profile web --patch /absolute/path/to/dsh-ocr-plugin/cordis.patch.yml
```



## 配置

### 获取 API 密钥

前往 [小笨羊官网](https://xiaobenyang.com) 注册并获取 API 密钥。

Install

dsh plugin --profile web add github:xby-skill/xby-bilibili

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source