哔哩哔哩视频信息获取
这是一个基于MCP(模型上下文协议)的服务器,可以获取Bilibili视频的字幕、弹幕和评论信息。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"bilibili-video-info-mcp": {
"args": [
"bilibili-video-info-mcp"
],
"command": "uvx",
"env": {
"SESSDATA": "your valid sessdata"
}
}
}
}
该服务需要配置环境变量:SESSDATA
服务介绍
MCP Server for Bilibili Video Info
This is a server based on MCP (Model Context Protocol) that can fetch subtitles, danmaku (bullet comments), and comments information of Bilibili videos.
MCP Tool List
1. Get Video Subtitles List
json
{
"name": "get_subtitles",
"arguments": {
"url": "https://www.bilibili.com/video/BV1x341177NN"
}
}
2. Get Video Danmaku
json
{
"name": "get_danmaku",
"arguments": {
"url": "https://www.bilibili.com/video/BV1x341177NN"
}
}
3. Get Video Comments
json
{
"name": "get_comments",
"arguments": {
"url": "https://www.bilibili.com/video/BV1x341177NN"
}
}
Usage
MCP Client Configuration
json
{
"mcpServers": {
"bilibili-video-info-mcp": {
"command": "uvx",
"args": [
"bilibili-video-info-mcp"
],
"env": {
"SESSDATA": "your valid sessdata"
}
}
}
}
Frequently Asked Questions
1. What to do if SESSDATA cannot be found?
- Log in to the Bilibili website.
- Open the browser developer tools (F12).
- Go to Application/Storage -> Cookies.
- Find the value corresponding to SESSDATA.
2. Error: "SESSDATA environment variable is required"
Make sure the environment variable is set:
bash
export SESSDATA="your SESSDATA value"
3. Which formats of video links are supported?
Standard Bilibili video links are supported, such as:
- https://www.bilibili.com/video/BV1x341177NN
- https://b23.tv/xxxxx (short link)
- Any link containing the BV number
License
MIT