@xzxzzx/bilibili-mcp 1.9.1 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -39
- package/README_EN.md +48 -39
- package/assets/readme/hero-en.svg +57 -37
- package/assets/readme/hero.svg +58 -38
- package/dist/bilibili/favorites.d.ts +9 -0
- package/dist/bilibili/favorites.d.ts.map +1 -0
- package/dist/bilibili/favorites.js +283 -0
- package/dist/bilibili/favorites.js.map +1 -0
- package/dist/bilibili/types.d.ts +22 -0
- package/dist/bilibili/types.d.ts.map +1 -1
- package/dist/server/tool-handlers.d.ts.map +1 -1
- package/dist/server/tool-handlers.js +17 -1
- package/dist/server/tool-handlers.js.map +1 -1
- package/dist/server/tool-schemas.d.ts.map +1 -1
- package/dist/server/tool-schemas.js +60 -0
- package/dist/server/tool-schemas.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +3 -2
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/validation.d.ts +6 -0
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +18 -0
- package/dist/utils/validation.js.map +1 -1
- package/docs/tool-reference.en.md +48 -3
- package/docs/tool-reference.md +48 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="./assets/readme/hero.svg" width="100%" alt="Bilibili MCP
|
|
2
|
+
<img src="./assets/readme/hero.svg" width="100%" alt="Bilibili MCP:自动读取当前账号的全部收藏夹,并通过 next_cursor 逐页遍历视频">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# Bilibili MCP
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
|
-
让 Codex、Claude、Cursor 等 AI
|
|
14
|
+
让 Codex、Claude、Cursor 等 AI 客户端从 Bilibili 主题或当前账号的收藏夹出发,获得可继续调用的 BVID、字幕上下文和可直达播放时刻的证据链接。
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
17
|
<p align="center">
|
|
@@ -23,59 +23,67 @@
|
|
|
23
23
|
<a href="https://github.com/XZXZZX-Ai/bilibili-mcp/releases/latest">最新 Release</a>
|
|
24
24
|
</p>
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
## 两个入口,一条证据链
|
|
27
|
+
|
|
28
|
+
- **从我的收藏夹开始**:首次调用无需 Folder ID;Agent 每次读取一个最多 20 条的上游页面,并把返回的 `next_cursor` 原样用于下一次调用,直到响应不再包含它。
|
|
29
|
+
- **从一个主题开始**:按关键词返回最多 10 个普通视频候选,不自动抓取候选的字幕或评论。
|
|
30
|
+
- **拿到 BVID 之后**:继续读取字幕、元数据、章节或热门评论;关键词命中可返回直达播放时刻的 `timestamp_url`。
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
> [!NOTE]
|
|
33
|
+
> **真实验收链路:**搜索视频 → 选择 `BV1Eb411u7Fw` 的 P4 → 在字幕中搜索“函数” → 返回上下文与可直达的 [`?p=4&t=1.12`](https://www.bilibili.com/video/BV1Eb411u7Fw/?p=4&t=1.12) 证据链接。视频搜索、收藏夹分页和转录的成功结果都同时提供兼容文本与 MCP `structuredContent`。
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
## 先让 Agent 帮你接入
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
Agent 安装提示词、全部客户端配置位置、CLI / JSON / TOML 示例、Cookie 配置与登录验证,都集中在唯一完整入口:
|
|
34
38
|
|
|
35
|
-
|
|
36
|
-
> 本 README 不再重复任何安装或配置方法。请以安装指南为唯一完整来源。
|
|
39
|
+
### [打开 Agent / 客户端安装指南 →](./docs/client-setup.md)
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
安装完成后,可以直接测试收藏夹遍历:
|
|
39
42
|
|
|
40
43
|
```text
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
读取我当前登录账号创建的全部收藏夹。每次拿到 next_cursor 就继续调用,
|
|
45
|
+
直到响应不再包含 next_cursor;按收藏夹列出视频标题和 BVID,不要生成笔记。
|
|
43
46
|
```
|
|
44
47
|
|
|
45
|
-
##
|
|
48
|
+
## 10 个工具,分成三层
|
|
49
|
+
|
|
50
|
+
### 发现入口
|
|
51
|
+
|
|
52
|
+
`search_bilibili_videos` · `list_bilibili_favorite_videos`
|
|
53
|
+
|
|
54
|
+
从主题或当前账号的全部收藏夹获得 BVID。
|
|
55
|
+
|
|
56
|
+
### 内容证据
|
|
57
|
+
|
|
58
|
+
`get_video_transcript` · `get_video_info` · `get_video_metadata` · `get_video_chapters` · `get_video_comments`
|
|
59
|
+
|
|
60
|
+
读取字幕、时间定位、视频信息、章节和观众反馈。
|
|
61
|
+
|
|
62
|
+
### 本机助手
|
|
63
|
+
|
|
64
|
+
`get_credential_setup_instructions` · `check_bilibili_credentials` · `check_mcp_update`
|
|
46
65
|
|
|
47
|
-
|
|
48
|
-
|---|---|---|
|
|
49
|
-
| 只有主题,还没有视频链接 | `search_bilibili_videos` | 最多 10 个普通视频候选及可继续调用的 BVID |
|
|
50
|
-
| 获取纯字幕或定位关键词 | `get_video_transcript` | 转录文本、语言、时间戳、区间过滤、关键词上下文与证据链接 |
|
|
51
|
-
| 让 AI 总结视频 | `get_video_info` | 字幕优先;无字幕时可返回标题、简介和标签 |
|
|
52
|
-
| 查看结构化视频信息 | `get_video_metadata` | 标题、作者、时长、发布时间、标签、统计数据和多 P 列表 |
|
|
53
|
-
| 查看视频章节 | `get_video_chapters` | 创作者或平台定义的章节标题与起止时间 |
|
|
54
|
-
| 查看观众反馈 | `get_video_comments` | 热门评论、时间戳评论和可选回复 |
|
|
55
|
-
| 获取安全配置步骤 | `get_credential_setup_instructions` | 本机凭证配置命令与双语安全提醒 |
|
|
56
|
-
| 检查登录凭证 | `check_bilibili_credentials` | 配置来源、登录状态和下一步建议,不返回 Cookie |
|
|
57
|
-
| 检查 MCP 更新 | `check_mcp_update` | 当前版本、最新版本和安全更新命令 |
|
|
66
|
+
安全配置凭证、确认登录并检查版本。
|
|
58
67
|
|
|
59
68
|
完整参数、JSON 示例、结构化错误和请求控制见[工具参考](./docs/tool-reference.md)。
|
|
60
69
|
|
|
61
|
-
|
|
70
|
+
## 设计重点
|
|
62
71
|
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
- **安全的凭证助手**:检查凭证状态时不返回 `SESSDATA`、`bili_jct`、`DedeUserID` 或完整 Cookie。
|
|
72
|
+
- **Bilibili 原生**:保留多 P、平台章节、热门评论和收藏夹成员关系,不把项目扩成通用下载器。
|
|
73
|
+
- **证据优先**:字幕支持语言偏好、时间戳、时间区间与关键词上下文;命中项可以直接打开对应播放时刻。
|
|
74
|
+
- **按需调用**:收藏夹工具只返回 Folder 上下文和视频条目,不自动生成笔记,也不预取字幕、评论或章节。
|
|
75
|
+
- **凭证留在本机**:状态工具不会返回 `SESSDATA`、`bili_jct`、`DedeUserID` 或完整 Cookie。
|
|
68
76
|
|
|
69
|
-
##
|
|
77
|
+
## 行为边界
|
|
70
78
|
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
79
|
+
- “全部收藏夹”指当前登录账号创建、且 Bilibili API 当前可见的 Folder;遍历是实时 best-effort,不是快照。
|
|
80
|
+
- 每次收藏夹调用最多读取一个 20 条上游页面。Agent 必须持续跟随 `next_cursor`;失效或无法安全规范化的条目会计入 `skipped_count`。
|
|
81
|
+
- 视频搜索和收藏夹发现都要求有效登录凭证,不提供匿名降级。
|
|
82
|
+
- `get_video_transcript` 默认在无字幕时返回 `SUBTITLE_UNAVAILABLE`;只有显式设置 `fallback_to_description: true` 才会退回简介,时间定位与关键词搜索不会静默退回简介。
|
|
83
|
+
- 章节只使用 Bilibili 创作者或平台数据;项目不会绕过付费、会员、地区、私密、下架或其他访问限制。
|
|
76
84
|
- 所有请求由用户本机发起;本项目是第三方工具,不是 Bilibili 官方服务。
|
|
77
85
|
|
|
78
|
-
##
|
|
86
|
+
## 开发
|
|
79
87
|
|
|
80
88
|
源码开发环境的安装步骤也集中在[完整安装指南:从源码开发](./docs/client-setup.md#从源码开发)。
|
|
81
89
|
|
|
@@ -89,13 +97,13 @@ Agent 安装提示词、全部客户端配置位置、CLI / JSON / TOML 示例
|
|
|
89
97
|
|
|
90
98
|
MCP stdio 协议使用 `stdout`;调试日志必须写到 `stderr`。测试和日志中不要使用真实 Cookie。
|
|
91
99
|
|
|
92
|
-
##
|
|
100
|
+
## 安全与许可
|
|
93
101
|
|
|
94
102
|
- 请遵守 Bilibili 用户协议、接口访问规则和当地法律法规,不要用于大规模抓取、商业剥削、绕过权限或其他滥用场景。
|
|
95
103
|
- 高频调用、异常访问模式或 Cookie 泄露可能触发限流、风控或账号异常,相关风险由使用者承担。
|
|
96
104
|
- 本项目仅向 Bilibili 官方接口发送 Bilibili 凭证,不会把 Cookie 上传到第三方服务;本地配置文件不承诺系统级加密。
|
|
97
105
|
- 本项目基于 [GNU General Public License v3.0](./LICENSE) 开源。
|
|
98
106
|
|
|
99
|
-
##
|
|
107
|
+
## 反馈
|
|
100
108
|
|
|
101
109
|
遇到问题或有功能建议,请提交 [GitHub Issue](https://github.com/XZXZZX-Ai/bilibili-mcp/issues);一般讨论可前往 [GitHub Discussions](https://github.com/XZXZZX-Ai/bilibili-mcp/discussions)。
|
package/README_EN.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="./assets/readme/hero-en.svg" width="100%" alt="Bilibili MCP:
|
|
2
|
+
<img src="./assets/readme/hero-en.svg" width="100%" alt="Bilibili MCP: traverse every Favorite Folder page by page by following next_cursor">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# Bilibili MCP
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
|
-
|
|
14
|
+
Let Codex, Claude, Cursor, and other AI clients start from a Bilibili topic or the current account's Favorite Folders, then retrieve reusable BVIDs, transcript context, and evidence links that open at the exact playback time.
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
17
|
<p align="center">
|
|
@@ -23,59 +23,68 @@
|
|
|
23
23
|
<a href="https://github.com/XZXZZX-Ai/bilibili-mcp/releases/latest">Latest release</a>
|
|
24
24
|
</p>
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
## Two entrances, one evidence path
|
|
27
|
+
|
|
28
|
+
- **Start from my Favorites:** the first call needs no Folder ID. The Agent reads one upstream page of at most 20 rows, passes each returned `next_cursor` into the next call, and stops only when that field is absent.
|
|
29
|
+
- **Start from a topic:** receive up to 10 normal-video candidates without automatically fetching candidate transcripts or comments.
|
|
30
|
+
- **After obtaining a BVID:** retrieve its transcript, metadata, chapters, or popular comments. Keyword matches can include a direct `timestamp_url`.
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
> [!NOTE]
|
|
33
|
+
> **Verified workflow:** search → select Part 4 of `BV1Eb411u7Fw` → search its transcript for “函数” → receive bounded context and a direct [`?p=4&t=1.12`](https://www.bilibili.com/video/BV1Eb411u7Fw/?p=4&t=1.12) evidence link. Successful Video Search, Favorites-page, and transcript calls all provide compatible text plus MCP `structuredContent`.
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
## Let an Agent set it up
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
The copyable Agent prompt, every client configuration location, CLI / JSON / TOML examples, Cookie setup, and login verification live in one complete source:
|
|
34
38
|
|
|
35
|
-
|
|
36
|
-
> This README no longer duplicates installation or configuration methods. Treat the installation guide as the complete source.
|
|
39
|
+
### [Open the Agent / client installation guide →](./docs/client-setup.en.md)
|
|
37
40
|
|
|
38
|
-
After installation,
|
|
41
|
+
After installation, test the complete Favorites traversal:
|
|
39
42
|
|
|
40
43
|
```text
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
Read every Favorite Folder created by my currently logged-in account.
|
|
45
|
+
Whenever a response contains next_cursor, keep calling with it until that field
|
|
46
|
+
is absent. Group the video titles and BVIDs by Folder; do not generate notes.
|
|
43
47
|
```
|
|
44
48
|
|
|
45
|
-
##
|
|
49
|
+
## Ten tools in three layers
|
|
50
|
+
|
|
51
|
+
### Discovery
|
|
52
|
+
|
|
53
|
+
`search_bilibili_videos` · `list_bilibili_favorite_videos`
|
|
54
|
+
|
|
55
|
+
Obtain BVIDs from a topic or every created Favorite Folder on the current account.
|
|
56
|
+
|
|
57
|
+
### Content evidence
|
|
58
|
+
|
|
59
|
+
`get_video_transcript` · `get_video_info` · `get_video_metadata` · `get_video_chapters` · `get_video_comments`
|
|
60
|
+
|
|
61
|
+
Retrieve transcripts, timestamps, Video information, chapters, and viewer feedback.
|
|
62
|
+
|
|
63
|
+
### Local helpers
|
|
64
|
+
|
|
65
|
+
`get_credential_setup_instructions` · `check_bilibili_credentials` · `check_mcp_update`
|
|
46
66
|
|
|
47
|
-
|
|
48
|
-
|---|---|---|
|
|
49
|
-
| Start with a topic, not a video URL | `search_bilibili_videos` | Up to 10 normal-video candidates with reusable BVIDs |
|
|
50
|
-
| Get a transcript or locate a keyword | `get_video_transcript` | Text, language, timestamps, range filters, keyword context, and evidence links |
|
|
51
|
-
| Ask AI to summarize a video | `get_video_info` | Subtitles first; title, description, and tags when subtitles are unavailable |
|
|
52
|
-
| Inspect structured video information | `get_video_metadata` | Title, creator, duration, publish time, tags, statistics, and multi-Part listing |
|
|
53
|
-
| Read video chapters | `get_video_chapters` | Creator- or platform-defined chapter titles and time ranges |
|
|
54
|
-
| Inspect viewer feedback | `get_video_comments` | Popular comments, timestamped comments, and optional replies |
|
|
55
|
-
| Get safe credential instructions | `get_credential_setup_instructions` | Local setup commands and bilingual security notes |
|
|
56
|
-
| Check login credentials | `check_bilibili_credentials` | Source, login status, and recovery steps without Cookie values |
|
|
57
|
-
| Check for package updates | `check_mcp_update` | Current/latest versions and safe update commands |
|
|
67
|
+
Configure credentials safely, verify login, and check the package version.
|
|
58
68
|
|
|
59
69
|
See the [tool reference](./docs/tool-reference.en.md) for complete parameters, JSON examples, structured errors, and request controls.
|
|
60
70
|
|
|
61
|
-
|
|
71
|
+
## Design priorities
|
|
62
72
|
|
|
63
|
-
- **
|
|
64
|
-
- **
|
|
65
|
-
- **
|
|
66
|
-
- **
|
|
67
|
-
- **Credential-safe helpers:** status checks never return `SESSDATA`, `bili_jct`, `DedeUserID`, or a complete Cookie.
|
|
73
|
+
- **Bilibili-native:** preserve multi-Part Videos, platform Chapters, popular comments, and Favorite Membership instead of becoming a generic downloader.
|
|
74
|
+
- **Evidence-first:** select a language, add timestamps, filter a time range, or search bounded transcript context; matches can open at the exact playback time.
|
|
75
|
+
- **On demand:** Favorites discovery returns Folder context and Video rows only. It does not generate notes or prefetch transcripts, comments, or Chapters.
|
|
76
|
+
- **Credentials stay local:** status tools never return `SESSDATA`, `bili_jct`, `DedeUserID`, or a complete Cookie.
|
|
68
77
|
|
|
69
|
-
##
|
|
78
|
+
## Behavior boundaries
|
|
70
79
|
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
80
|
+
- “Every Favorite Folder” means Folders created by the currently logged-in account and currently visible through the Bilibili API. Traversal is live best effort, not a snapshot.
|
|
81
|
+
- Each Favorites call reads at most one upstream 20-row page. The Agent must keep following `next_cursor`; removed or unsafe-to-normalize rows are counted in `skipped_count`.
|
|
82
|
+
- Video Search and Favorites discovery require valid logged-in credentials and do not fall back to anonymous requests.
|
|
83
|
+
- `get_video_transcript` returns `SUBTITLE_UNAVAILABLE` by default when no subtitle exists. Description fallback requires explicit `fallback_to_description: true`; timed output and keyword search never silently use a description.
|
|
84
|
+
- Chapters come only from Bilibili creator/platform data. The project does not bypass paid, member-only, regional, private, removed, or other access restrictions.
|
|
76
85
|
- Requests originate on the user's machine. This is a third-party project, not an official Bilibili service.
|
|
77
86
|
|
|
78
|
-
##
|
|
87
|
+
## Development
|
|
79
88
|
|
|
80
89
|
Source-development setup is also centralized in the [complete installation guide: develop from source](./docs/client-setup.en.md#develop-from-source).
|
|
81
90
|
|
|
@@ -89,13 +98,13 @@ Source-development setup is also centralized in the [complete installation guide
|
|
|
89
98
|
|
|
90
99
|
MCP stdio protocol data uses `stdout`; diagnostics must go to `stderr`. Never use real Cookie values in tests or logs.
|
|
91
100
|
|
|
92
|
-
##
|
|
101
|
+
## Safety and license
|
|
93
102
|
|
|
94
103
|
- Follow Bilibili's terms, interface-access rules, and applicable law. Do not use this project for bulk scraping, commercial exploitation, permission bypass, or other abuse.
|
|
95
104
|
- High request volume, unusual access patterns, or leaked Cookies may trigger throttling, risk controls, or account issues. Users accept those risks.
|
|
96
105
|
- The project sends Bilibili credentials only to official Bilibili interfaces and does not upload Cookies to third-party services. Local credential files do not promise operating-system-level encryption.
|
|
97
106
|
- This project is licensed under the [GNU General Public License v3.0](./LICENSE).
|
|
98
107
|
|
|
99
|
-
##
|
|
108
|
+
## Feedback
|
|
100
109
|
|
|
101
110
|
For bugs and feature requests, open a [GitHub Issue](https://github.com/XZXZZX-Ai/bilibili-mcp/issues). Use [GitHub Discussions](https://github.com/XZXZZX-Ai/bilibili-mcp/discussions) for general questions.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
2
|
-
width="1200" height="
|
|
2
|
+
width="1200" height="420" viewBox="0 0 1200 420"
|
|
3
3
|
role="img" aria-labelledby="title desc">
|
|
4
4
|
<title id="title">Bilibili MCP</title>
|
|
5
|
-
<desc id="desc">
|
|
5
|
+
<desc id="desc">Automatically discover every Favorite Folder created by the authenticated account. Start without a cursor, read at most 20 videos per call, and keep passing next_cursor into the next call until that field is absent.</desc>
|
|
6
6
|
|
|
7
|
-
<rect width="1200" height="
|
|
7
|
+
<rect width="1200" height="420" rx="28" fill="#090b10"/>
|
|
8
8
|
<path d="M0 206H1200" stroke="#232936"/>
|
|
9
9
|
|
|
10
10
|
<g id="title-block">
|
|
@@ -17,66 +17,86 @@
|
|
|
17
17
|
<rect x="64" y="138" width="92" height="4" rx="2" fill="#fb7299"/>
|
|
18
18
|
<text x="64" y="178" fill="#b8c5d3"
|
|
19
19
|
font-family="Segoe UI, Arial, sans-serif"
|
|
20
|
-
font-size="
|
|
20
|
+
font-size="23">Read every Favorite Folder. Follow next_cursor until traversal is complete.</text>
|
|
21
21
|
</g>
|
|
22
22
|
|
|
23
|
-
<g id="status" transform="translate(852
|
|
24
|
-
<rect width="284" height="
|
|
23
|
+
<g id="status" transform="translate(852 52)">
|
|
24
|
+
<rect width="284" height="96" rx="18" fill="#11151d" stroke="#303746"/>
|
|
25
25
|
<circle cx="28" cy="30" r="6" fill="#22c55e"/>
|
|
26
26
|
<text x="46" y="31" dominant-baseline="middle" fill="#86efac"
|
|
27
27
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
28
28
|
font-size="18">MCP READY</text>
|
|
29
29
|
<path d="M24 50H260" stroke="#29303c"/>
|
|
30
|
-
<text x="142" y="
|
|
30
|
+
<text x="142" y="73" dominant-baseline="middle" text-anchor="middle" fill="#93a4b8"
|
|
31
31
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
32
|
-
font-size="18">
|
|
32
|
+
font-size="18">FAVORITES · PAGE ≤ 20</text>
|
|
33
33
|
</g>
|
|
34
34
|
|
|
35
|
-
<g id="
|
|
36
|
-
<g id="
|
|
37
|
-
<rect width="
|
|
38
|
-
<text x="
|
|
35
|
+
<g id="favorites-flow" transform="translate(64 232)">
|
|
36
|
+
<g id="start">
|
|
37
|
+
<rect width="244" height="140" rx="18" fill="#11151d" stroke="#303746"/>
|
|
38
|
+
<text x="20" y="26" dominant-baseline="middle" fill="#fb7299"
|
|
39
39
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
40
|
-
font-size="18">01 ·
|
|
41
|
-
<
|
|
40
|
+
font-size="18">01 · START</text>
|
|
41
|
+
<path d="M20 44H224" stroke="#29303c"/>
|
|
42
|
+
<text x="20" y="78" dominant-baseline="middle" fill="#f8fafc"
|
|
42
43
|
font-family="Segoe UI, Arial, sans-serif"
|
|
43
|
-
font-size="
|
|
44
|
-
<text x="
|
|
44
|
+
font-size="19" font-weight="600">DISCOVER ALL FOLDERS</text>
|
|
45
|
+
<text x="20" y="112" dominant-baseline="middle" fill="#93a4b8"
|
|
45
46
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
46
|
-
font-size="18">
|
|
47
|
+
font-size="18">NO CURSOR TO START</text>
|
|
47
48
|
</g>
|
|
48
49
|
|
|
49
|
-
<path d="
|
|
50
|
+
<path d="M256 70H264M257 63L264 70L257 77"
|
|
50
51
|
fill="none" stroke="#fb7299" stroke-width="2"/>
|
|
51
52
|
|
|
52
|
-
<g id="
|
|
53
|
-
<rect width="
|
|
54
|
-
<text x="
|
|
53
|
+
<g id="read-page" transform="translate(276 0)">
|
|
54
|
+
<rect width="244" height="140" rx="18" fill="#11151d" stroke="#00aeec"/>
|
|
55
|
+
<text x="20" y="26" dominant-baseline="middle" fill="#7dd3fc"
|
|
55
56
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
56
|
-
font-size="18">02 ·
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
font-size="24">BV1Eb411u7Fw · P4</text>
|
|
60
|
-
<text x="22" y="94" dominant-baseline="middle" fill="#93a4b8"
|
|
57
|
+
font-size="18">02 · READ PAGE</text>
|
|
58
|
+
<path d="M20 44H224" stroke="#29303c"/>
|
|
59
|
+
<text x="20" y="78" dominant-baseline="middle" fill="#f8fafc"
|
|
61
60
|
font-family="Segoe UI, Arial, sans-serif"
|
|
62
|
-
font-size="18">
|
|
61
|
+
font-size="18" font-weight="600">CURRENT FOLDER + PAGE</text>
|
|
62
|
+
<text x="20" y="112" dominant-baseline="middle" fill="#93a4b8"
|
|
63
|
+
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
64
|
+
font-size="18">VIDEOS[] · UP TO 20</text>
|
|
63
65
|
</g>
|
|
64
66
|
|
|
65
|
-
<path d="
|
|
67
|
+
<path d="M532 70H540M533 63L540 70L533 77"
|
|
66
68
|
fill="none" stroke="#00aeec" stroke-width="2"/>
|
|
67
69
|
|
|
68
|
-
<g id="
|
|
69
|
-
<rect width="
|
|
70
|
-
<text x="
|
|
70
|
+
<g id="continue" transform="translate(552 0)">
|
|
71
|
+
<rect width="244" height="140" rx="18" fill="#11151d" stroke="#fb7299"/>
|
|
72
|
+
<text x="20" y="26" dominant-baseline="middle" fill="#fb7299"
|
|
73
|
+
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
74
|
+
font-size="18">03 · CONTINUE</text>
|
|
75
|
+
<path d="M20 44H224" stroke="#29303c"/>
|
|
76
|
+
<text x="20" y="78" dominant-baseline="middle" fill="#f8fafc"
|
|
77
|
+
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
78
|
+
font-size="18">RETURNED next_cursor</text>
|
|
79
|
+
<text x="20" y="112" dominant-baseline="middle" fill="#93a4b8"
|
|
80
|
+
font-family="Segoe UI, Arial, sans-serif"
|
|
81
|
+
font-size="18">PASS INTO NEXT CALL</text>
|
|
82
|
+
</g>
|
|
83
|
+
|
|
84
|
+
<path d="M808 70H816M809 63L816 70L809 77"
|
|
85
|
+
fill="none" stroke="#22c55e" stroke-width="2"/>
|
|
86
|
+
|
|
87
|
+
<g id="complete" transform="translate(828 0)">
|
|
88
|
+
<rect width="244" height="140" rx="18" fill="#0d2118" stroke="#237f50"/>
|
|
89
|
+
<text x="20" y="26" dominant-baseline="middle" fill="#86efac"
|
|
71
90
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
72
|
-
font-size="18">
|
|
73
|
-
<
|
|
91
|
+
font-size="18">04 · COMPLETE</text>
|
|
92
|
+
<circle cx="216" cy="26" r="7" fill="#22c55e"/>
|
|
93
|
+
<path d="M20 44H224" stroke="#244a37"/>
|
|
94
|
+
<text x="20" y="78" dominant-baseline="middle" fill="#f8fafc"
|
|
74
95
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
75
|
-
font-size="
|
|
76
|
-
<text x="
|
|
96
|
+
font-size="18">NO next_cursor</text>
|
|
97
|
+
<text x="20" y="112" dominant-baseline="middle" fill="#b8c5d3"
|
|
77
98
|
font-family="Segoe UI, Arial, sans-serif"
|
|
78
|
-
font-size="
|
|
79
|
-
<circle cx="368" cy="28" r="7" fill="#22c55e"/>
|
|
99
|
+
font-size="19">ALL TITLES + BVIDS</text>
|
|
80
100
|
</g>
|
|
81
101
|
</g>
|
|
82
102
|
</svg>
|
package/assets/readme/hero.svg
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
2
|
-
width="1200" height="
|
|
2
|
+
width="1200" height="420" viewBox="0 0 1200 420"
|
|
3
3
|
role="img" aria-labelledby="title desc">
|
|
4
4
|
<title id="title">Bilibili MCP</title>
|
|
5
|
-
<desc id="desc"
|
|
5
|
+
<desc id="desc">自动发现当前登录账号创建的全部收藏夹。首次调用不传游标,每次读取最多 20 条视频,持续把 next_cursor 传入下一次调用,直到该字段不再返回。</desc>
|
|
6
6
|
|
|
7
|
-
<rect width="1200" height="
|
|
7
|
+
<rect width="1200" height="420" rx="28" fill="#090b10"/>
|
|
8
8
|
<path d="M0 206H1200" stroke="#232936"/>
|
|
9
9
|
|
|
10
10
|
<g id="title-block">
|
|
@@ -17,66 +17,86 @@
|
|
|
17
17
|
<rect x="64" y="138" width="92" height="4" rx="2" fill="#fb7299"/>
|
|
18
18
|
<text x="64" y="178" fill="#b8c5d3"
|
|
19
19
|
font-family="Segoe UI, Microsoft YaHei, PingFang SC, sans-serif"
|
|
20
|
-
font-size="24"
|
|
20
|
+
font-size="24">读取当前账号全部收藏夹;Agent 跟随 next_cursor 直到遍历结束。</text>
|
|
21
21
|
</g>
|
|
22
22
|
|
|
23
|
-
<g id="status" transform="translate(852
|
|
24
|
-
<rect width="284" height="
|
|
23
|
+
<g id="status" transform="translate(852 52)">
|
|
24
|
+
<rect width="284" height="96" rx="18" fill="#11151d" stroke="#303746"/>
|
|
25
25
|
<circle cx="28" cy="30" r="6" fill="#22c55e"/>
|
|
26
26
|
<text x="46" y="31" dominant-baseline="middle" fill="#86efac"
|
|
27
27
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
28
28
|
font-size="18">MCP READY</text>
|
|
29
29
|
<path d="M24 50H260" stroke="#29303c"/>
|
|
30
|
-
<text x="142" y="
|
|
30
|
+
<text x="142" y="73" dominant-baseline="middle" text-anchor="middle" fill="#93a4b8"
|
|
31
31
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
32
|
-
font-size="18">
|
|
32
|
+
font-size="18">FAVORITES · PAGE ≤ 20</text>
|
|
33
33
|
</g>
|
|
34
34
|
|
|
35
|
-
<g id="
|
|
36
|
-
<g id="
|
|
37
|
-
<rect width="
|
|
38
|
-
<text x="
|
|
35
|
+
<g id="favorites-flow" transform="translate(64 232)">
|
|
36
|
+
<g id="start">
|
|
37
|
+
<rect width="244" height="140" rx="18" fill="#11151d" stroke="#303746"/>
|
|
38
|
+
<text x="20" y="26" dominant-baseline="middle" fill="#fb7299"
|
|
39
39
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
40
|
-
font-size="18">01 ·
|
|
41
|
-
<
|
|
40
|
+
font-size="18">01 · START</text>
|
|
41
|
+
<path d="M20 44H224" stroke="#29303c"/>
|
|
42
|
+
<text x="20" y="78" dominant-baseline="middle" fill="#f8fafc"
|
|
42
43
|
font-family="Segoe UI, Microsoft YaHei, PingFang SC, sans-serif"
|
|
43
|
-
font-size="
|
|
44
|
-
<text x="
|
|
45
|
-
font-family="
|
|
46
|
-
font-size="18"
|
|
44
|
+
font-size="20" font-weight="600">自动发现全部收藏夹</text>
|
|
45
|
+
<text x="20" y="112" dominant-baseline="middle" fill="#93a4b8"
|
|
46
|
+
font-family="Segoe UI, Microsoft YaHei, PingFang SC, sans-serif"
|
|
47
|
+
font-size="18">首次不传 cursor</text>
|
|
47
48
|
</g>
|
|
48
49
|
|
|
49
|
-
<path d="
|
|
50
|
+
<path d="M256 70H264M257 63L264 70L257 77"
|
|
50
51
|
fill="none" stroke="#fb7299" stroke-width="2"/>
|
|
51
52
|
|
|
52
|
-
<g id="
|
|
53
|
-
<rect width="
|
|
54
|
-
<text x="
|
|
55
|
-
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
56
|
-
font-size="18">02 · LOCATE</text>
|
|
57
|
-
<text x="22" y="64" dominant-baseline="middle" fill="#f8fafc"
|
|
53
|
+
<g id="read-page" transform="translate(276 0)">
|
|
54
|
+
<rect width="244" height="140" rx="18" fill="#11151d" stroke="#00aeec"/>
|
|
55
|
+
<text x="20" y="26" dominant-baseline="middle" fill="#7dd3fc"
|
|
58
56
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
59
|
-
font-size="
|
|
60
|
-
<
|
|
57
|
+
font-size="18">02 · READ PAGE</text>
|
|
58
|
+
<path d="M20 44H224" stroke="#29303c"/>
|
|
59
|
+
<text x="20" y="78" dominant-baseline="middle" fill="#f8fafc"
|
|
61
60
|
font-family="Segoe UI, Microsoft YaHei, PingFang SC, sans-serif"
|
|
62
|
-
font-size="
|
|
61
|
+
font-size="20" font-weight="600">当前 Folder · 当前页</text>
|
|
62
|
+
<text x="20" y="112" dominant-baseline="middle" fill="#93a4b8"
|
|
63
|
+
font-family="Segoe UI, Microsoft YaHei, PingFang SC, sans-serif"
|
|
64
|
+
font-size="18">videos[] · 最多 20 条</text>
|
|
63
65
|
</g>
|
|
64
66
|
|
|
65
|
-
<path d="
|
|
67
|
+
<path d="M532 70H540M533 63L540 70L533 77"
|
|
66
68
|
fill="none" stroke="#00aeec" stroke-width="2"/>
|
|
67
69
|
|
|
68
|
-
<g id="
|
|
69
|
-
<rect width="
|
|
70
|
-
<text x="
|
|
70
|
+
<g id="continue" transform="translate(552 0)">
|
|
71
|
+
<rect width="244" height="140" rx="18" fill="#11151d" stroke="#fb7299"/>
|
|
72
|
+
<text x="20" y="26" dominant-baseline="middle" fill="#fb7299"
|
|
71
73
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
72
|
-
font-size="18">03 ·
|
|
73
|
-
<
|
|
74
|
+
font-size="18">03 · CONTINUE</text>
|
|
75
|
+
<path d="M20 44H224" stroke="#29303c"/>
|
|
76
|
+
<text x="20" y="78" dominant-baseline="middle" fill="#f8fafc"
|
|
77
|
+
font-family="Segoe UI, Microsoft YaHei, PingFang SC, sans-serif"
|
|
78
|
+
font-size="19">返回 next_cursor</text>
|
|
79
|
+
<text x="20" y="112" dominant-baseline="middle" fill="#93a4b8"
|
|
80
|
+
font-family="Segoe UI, Microsoft YaHei, PingFang SC, sans-serif"
|
|
81
|
+
font-size="18">原样传入下一次调用</text>
|
|
82
|
+
</g>
|
|
83
|
+
|
|
84
|
+
<path d="M808 70H816M809 63L816 70L809 77"
|
|
85
|
+
fill="none" stroke="#22c55e" stroke-width="2"/>
|
|
86
|
+
|
|
87
|
+
<g id="complete" transform="translate(828 0)">
|
|
88
|
+
<rect width="244" height="140" rx="18" fill="#0d2118" stroke="#237f50"/>
|
|
89
|
+
<text x="20" y="26" dominant-baseline="middle" fill="#86efac"
|
|
74
90
|
font-family="Cascadia Mono, Consolas, SFMono-Regular, Menlo, monospace"
|
|
75
|
-
font-size="
|
|
76
|
-
<
|
|
91
|
+
font-size="18">04 · COMPLETE</text>
|
|
92
|
+
<circle cx="216" cy="26" r="7" fill="#22c55e"/>
|
|
93
|
+
<path d="M20 44H224" stroke="#244a37"/>
|
|
94
|
+
<text x="20" y="78" dominant-baseline="middle" fill="#f8fafc"
|
|
95
|
+
font-family="Segoe UI, Microsoft YaHei, PingFang SC, sans-serif"
|
|
96
|
+
font-size="19">无 next_cursor</text>
|
|
97
|
+
<text x="20" y="112" dominant-baseline="middle" fill="#b8c5d3"
|
|
77
98
|
font-family="Segoe UI, Microsoft YaHei, PingFang SC, sans-serif"
|
|
78
|
-
font-size="
|
|
79
|
-
<circle cx="368" cy="28" r="7" fill="#22c55e"/>
|
|
99
|
+
font-size="19">全部可见标题 + BVID</text>
|
|
80
100
|
</g>
|
|
81
101
|
</g>
|
|
82
102
|
</svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FavoriteVideoPage } from "./types.js";
|
|
2
|
+
export interface ResolvedCursor {
|
|
3
|
+
folderId: number;
|
|
4
|
+
page: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function encodeFavoritesCursor(folderId: number, page: number): string;
|
|
7
|
+
export declare function decodeFavoritesCursor(cursor: string): ResolvedCursor;
|
|
8
|
+
export declare function listBilibiliFavoriteVideos(cursor?: string): Promise<FavoriteVideoPage>;
|
|
9
|
+
//# sourceMappingURL=favorites.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"favorites.d.ts","sourceRoot":"","sources":["../../src/bilibili/favorites.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAyEpB,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,MAAM,CAeR;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CA6CpE;AAoHD,wBAAsB,0BAA0B,CAC9C,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,CAAC,CAmG5B"}
|