📖 介绍
nonebot-plugin-bilidyn 是一个 NoneBot2 B 站动态订阅推送插件,支持订阅 UP 主动态、直播开播通知、二维码登录和主动查询最新动态。
插件当前基于 bilibili-api-python 异步拉取数据,并使用 nonebot-plugin-localstore 管理缓存和持久化数据。
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-bilidyn --upgrade
使用 pypi 源安装
nb plugin install nonebot-plugin-bilidyn --upgrade -i "https://pypi.org/simple"
使用清华源安装
nb plugin install nonebot-plugin-bilidyn --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令uv
uv add nonebot-plugin-bilidyn
安装仓库 main 分支
uv add git+https://github.com/Misty02600/nonebot-plugin-bilidyn@main
pdm
pdm add nonebot-plugin-bilidyn
安装仓库 main 分支
pdm add git+https://github.com/Misty02600/nonebot-plugin-bilidyn@main
poetry
poetry add nonebot-plugin-bilidyn
安装仓库 main 分支
poetry add git+https://github.com/Misty02600/nonebot-plugin-bilidyn@main
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot_plugin_bilidyn"]
使用 nbr 安装(使用 uv 管理依赖可用)
nbr 是一个基于 uv 的 nb-cli,可以方便地管理 nonebot2
nbr plugin install nonebot-plugin-bilidyn
使用 pypi 源安装
nbr plugin install nonebot-plugin-bilidyn -i "https://pypi.org/simple"
使用清华源安装
nbr plugin install nonebot-plugin-bilidyn -i "https://pypi.tuna.tsinghua.edu.cn/simple"
⚙️ 配置
插件使用 nonebot_plugin_localstore 储存数据和缓存。
推荐使用 bili login 进行二维码登录。插件会把登录结果持久化到本地,后续重启会自动复用。
如需调整轮询或推送节奏,可在 NoneBot2 项目的 .env 文件中添加下列配置:
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
BILI_CHECK__DYNAMIC_MODE |
否 | per_up |
动态来源:per_up 逐 UP 拉取;follow_feed 使用登录账号的聚合关注流 |
BILI_CHECK__DYNAMIC_INTERVAL |
否 | 30 |
动态检测间隔,单位秒 |
BILI_CHECK__LIVE_INTERVAL |
否 | 30 |
直播检测间隔,单位秒 |
BILI_CHECK__LOW_SPEED_START |
否 | 1 |
低频时段起始小时 |
BILI_CHECK__LOW_SPEED_END |
否 | 9 |
低频时段结束小时 |
BILI_CHECK__LOW_SPEED_MULTIPLIER |
否 | 10 |
低频时段检测倍率 |
BILI_PUSH__PUSH_INTERVAL |
否 | 0.5 |
连续推送间隔,单位秒 |
per_up 逐个拉取 UP 动态。follow_feed 会自动关注订阅的 UP,扫码换号后补齐关注,并从关注流筛选推送;没有有效登录凭据时暂停检测。
登录失效时,插件会向最后一次成功登录所在的私聊发送一次提醒。
🎉 使用
指令表
| 指令 | 权限 | 说明 |
|---|---|---|
bili / bili help |
无 | 查看帮助文本 |
bili sub <UID> |
私聊 / 管理 / 超管 | 为当前会话订阅指定 UP 主 |
bili unsub <UID / 名称> |
私聊 / 管理 / 超管 | 取消当前会话对指定 UP 主的订阅 |
bili list |
无 | 查看当前会话订阅列表 |
bili clear [confirm] |
超管 | 扫描当前已失效的群推送配置,并在确认后批量清理 |
bili login |
私聊, 超管 | 发起二维码登录,并自动轮询扫码结果 |
bili new <UID / 名称> [count] |
无 | 主动查看某位 UP 主最近动态,默认 1 条,最多 5 条 |
🎨 效果图
- 动态卡片
- 直播卡片
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_bilidyn-0.3.0.tar.gz.
File metadata
- Download URL: nonebot_plugin_bilidyn-0.3.0.tar.gz
- Upload date:
- Size: 50.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3648640b420df4fea48f8553c90a596a3f4b070b58ef8886da9423e4e9765111
|
|
| MD5 |
e8a80edcb76ef8b6efd5fadab696cf88
|
|
| BLAKE2b-256 |
75f8a7d21ba2af00e34819d6e5151797451179c3c1fb8824bd87301bccc62026
|
File details
Details for the file nonebot_plugin_bilidyn-0.3.0-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_bilidyn-0.3.0-py3-none-any.whl
- Upload date:
- Size: 68.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
354cc39cf8635ca361f2fc5a3557001170b0751b81d34b7ba006400ed19ec229
|
|
| MD5 |
97109b48264edc723bb2bbb45b2aa4fd
|
|
| BLAKE2b-256 |
19a39e94afb450f4c734521ef6185b4ff38ed4b2eecfc52efe979e94de3bb891
|