ErisPulse-BiliParser
B站解析模块,自动解析消息中的B站链接(视频/图文动态/专栏/直播/番剧),渲染为 moe 风格卡片图展示。
功能
- 自动检测消息中的B站链接(支持 BV号、AV号、完整链接、b23.tv 短链接、动态/专栏/直播/番剧链接)
- 手动
/bili命令解析 - moe 风格卡片渲染:借助 ErisPulse-Takumi 将解析结果渲染为单张卡片图片(封面头图 + 统计徽章 + 正文 + 图片网格 + 热评),深浅色随时间自动切换
- 未安装 Takumi 或渲染失败时,自动回退为 封面图 + 富文本卡片(HTML > Markdown > 纯文本)
- 视频详情(标题、UP主、播放量、弹幕、点赞、投币、收藏、分享)与热门评论展示
- 图文动态:正文 + 全部图片(渲染时合并进同一张卡片,回退时拆分发送)
- 解析结果缓存
- 直接下载视频:消息中包含"看看/想看/播放/下载"等关键词 + 视频链接,直接发送视频文件
- 交互式下载:解析视频信息后,60秒内回复"我要看这个"即可下载视频
安装
epsdk install BiliParser
# 可选:启用卡片图片渲染
epsdk install Takumi
配置
在 config.toml 中添加:
[BiliParser]
auto_parse = true # 自动解析消息中的B站链接
show_cover = true # 发送封面图(非渲染回退模式生效)
show_comments = true # 显示热门评论
comment_count = 3 # 显示评论数量
show_description = false # 显示简介
max_desc_length = 100 # 简介最大长度
cache_ttl = 600 # 缓存过期时间(秒)
max_videos_per_message = 3 # 单条消息最多解析条数
enable_download = true # 启用视频下载功能
download_cooldown = 60 # 下载冷却时间(秒)
max_file_size = 104857600 # 最大文件大小(字节,默认100MB)
render_mode = "auto" # 卡片渲染:auto(装了 Takumi 就渲染)/ off(禁用)
render_width = 880 # 渲染卡片宽度(像素)
theme_mode = "auto" # 配色:auto(19:00-7:00 深色)/ light / dark
使用
自动解析
发送包含B站链接的消息,模块自动解析并渲染卡片:
看看这个视频 https://www.bilibili.com/video/BV1xx411c7mD
这个动态好笑 https://b23.tv/srW30Ee
直接下载视频
消息中同时包含视频链接和观看关键词(看看/想看/我要看/播放/下载等),直接发送视频文件,不显示解析信息:
看看这个视频 av170001
我想看 https://b23.tv/xxxxx
下载 BV1xx411c7mD
交互式下载
普通解析视频后会提示"回复「我要看这个」获取视频文件",在60秒内回复即可触发下载。
手动命令
/bili BV1xx411c7mD
/bili av2
/bili https://b23.tv/srW30Ee
/bili live.bilibili.com/21452505
/bili https://www.bilibili.com/read/cv8012559
支持的链接格式
| 类型 | 格式示例 |
|---|---|
| 视频 BV号 | BV1xx411c7mD |
| 视频 AV号 | av2 |
| 视频完整链接 | https://www.bilibili.com/video/BV1xx411c7mD |
| 图文动态 | https://b23.tv/srW30Ee、bilibili.com/opus/{id}、t.bilibili.com/{id} |
| 专栏 | bilibili.com/read/cv{id} |
| 直播间 | live.bilibili.com/{房间号} |
| 番剧/影视 | bilibili.com/bangumi/play/ep{id}、.../ss{id} |
| 短链接 | https://b23.tv/xxxxx(自动识别目标类型) |
触发下载的关键词
看看 想看 我要看 我想看 看这个 看看这个 看视频 播放 下载 发视频 发来 watch play download video
Metadata
Release files for ErisPulse-BiliParser 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| erispulse_biliparser-1.2.0.tar.gz | 19.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| erispulse_biliparser-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.3 kB
Release files / erispulse_biliparser-1.2.0.tar.gz
| Download URL | erispulse_biliparser-1.2.0.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0190ac2f14ff5c54d6fe6666a6e57e8abdefdea918ab64b74234112b25402b3a
|
|
BLAKE2b-256 checksum How to use checksums |
b12bd835012adf51952e11bfce6c7703cf0b1a04c13c3d7e0b2366714ac1ab75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / erispulse_biliparser-1.2.0-py3-none-any.whl
| Download URL | erispulse_biliparser-1.2.0-py3-none-any.whl |
|---|---|
| Size | 21.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a57275892ab91d515911285fd27d118d0a7e630af55d788efbf603771e22cfff
|
|
BLAKE2b-256 checksum How to use checksums |
47173ae25b4c4d7559b8c861b7329360c5f171f54aa0b2d09dcf7c218eb38d7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency log