nonebot-plugin-bili-query
✨ B站查询与提醒插件 for NoneBot2 ✨
功能
/用户查询- 查询B站用户信息(粉丝数、投稿数、最近视频等数据)/视频查询- 查询B站视频信息(播放量、点赞、投币、收藏等数据),支持 BV 号 / 完整链接 / b23.tv 短链接/订阅- 订阅UP主,新视频发布时自动在群里提醒/取消订阅- 取消订阅/help- 显示所有指令
安装,指令二选一
nb plugin install nonebot-plugin-bili-query
pip install nonebot-plugin-bili-query
使用
在群聊中 @机器人 并输入以下命令:
指令 参数 说明 /help 无 显示所有指令 /用户查询 UID或空间链接 查询用户信息 /视频查询 BV号或视频链接 查询视频信息 /订阅 UID或空间链接 订阅用户更新 /取消订阅 UID或空间链接 取消订阅
示例
/用户查询 123456
/用户查询 https://space.bilibili.com/123456
/视频查询 BV1xx411c7mD
/视频查询 https://b23.tv/AbCdEf
/订阅 123456
/取消订阅 123456
/help
对的/help后面啥都没有
配置
无需配置即可使用。可选配置项(写入 .env 文件):
bili_query_check_interval_minutes=5
订阅更新检查间隔(分钟),默认 5。
数据存储
订阅数据:使用 nonebot-plugin-localstore 管理,文件位于插件数据目录下 定时任务:使用 nonebot-plugin-apscheduler,按配置间隔检查订阅用户更新
注意事项
1️⃣ 需要机器人有发送群消息的权限 2️⃣ 订阅功能依赖定时任务,需确保机器人持续运行 3️⃣ 首次使用前无需额外配置 4️⃣ 订阅时会自动记录UP主当前最新视频作为基线,只有之后发布的新视频才会提醒
0.2.0 更新日志
修复了一系列问题:
- 修复致命 bug:
CommandArg()参数注解错误导致/用户查询、/视频查询、/订阅、/取消订阅在新版 nonebot2(2.4+ / pydantic v2)下完全无响应 - 修复 b23.tv 短链接查询始终失败的问题
- 修复 多个群订阅同一位UP主时,只有一个群能收到更新通知的问题
- 修复 首次检查时把UP主的历史最新视频误当作“新视频”播报的问题(现在订阅时自动建立基线)
- 修复 私聊使用
/订阅无任何响应的问题(现在会提示仅支持群聊) - 修复 多个 Bot 同时在线时订阅通知发送失败的问题
- 修复
httpx未声明依赖导致短链接解析在部分环境报ModuleNotFoundError - 修复
requires-python与依赖版本冲突(Python 3.9 无法安装),现要求 Python ≥ 3.10 - 新增配置项
bili_query_check_interval_minutes - 新增测试套件(nonebug + pytest),仓库增加
.gitignore与LICENSE
开发
pip install -e ".[test]"
pytest
开源协议
MIT
Metadata
Release files for nonebot-plugin-bili-query 0.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 | Provenance | |
|---|---|---|---|---|
| nonebot_plugin_bili_query-0.2.0.tar.gz | 16.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nonebot_plugin_bili_query-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.9 kB
Release files / nonebot_plugin_bili_query-0.2.0.tar.gz
| Download URL | nonebot_plugin_bili_query-0.2.0.tar.gz |
|---|---|
| Size | 16.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a9567dd55adc9e398659d7b4d7540aed17871addd6ff086064f160c685561aba
|
|
BLAKE2b-256 checksum How to use checksums |
c75573dc8a41205f657499ecbe5211d04482e8e7fb9aaf625ed57f101f5f3751
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / nonebot_plugin_bili_query-0.2.0-py3-none-any.whl
| Download URL | nonebot_plugin_bili_query-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9072abdc4f7c3a3365e1ecedd68bab1bcc1f3cbd11bb431093276314444c1615
|
|
BLAKE2b-256 checksum How to use checksums |
ebf73b2d597bded45fd414ffbf38eaed36af342207e0b9f5431c62bf4fb8d592
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for nonebot-plugin-bili-query 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.