NoneBot2 plugin for Bilibili update and live notifications
Project description
📖 介绍
B站UP的更新与开播通知机,默认每分钟爬取一次B站账号的动态与直播列表,将设置好的特定UP的更新或开播信息推送到QQ群里。
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-bilibili-notifier
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-bilibili-notifier
pdm
pdm add nonebot-plugin-bilibili-notifier
poetry
poetry add nonebot-plugin-bilibili-notifier
conda
conda install nonebot-plugin-bilibili-notifier
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot_plugin_bilibili_notifier"]
⚙️ 配置
首先用你的B站账号关注这些你想要追踪的UP主,并记住TA们的B站数字ID(以下简称BID):(点击主页后地址中显示的space.bilibili.com/[中的这个号码])。
然后导出B站cookies,建议使用Firefox的Export cookie JSON file for Puppeteer插件直接生成JSON文件,如果想手动生成,请确保以下字段有效:
{
"sessdata": "",
"bili_jct": "",
"buvid3": "",
"dedeuserid": ""
}
建议导出cookies时使用和常用的浏览器不同的浏览器(或匿名模式),不然B站会定时要求刷新你的cookies。
在 nonebot2 项目的.env文件中添加下表中的必填配置
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
| bnotifier_cookies | 是 | 无 | 上面导出的B站cookies的文件路径 |
| bnotifier_push_updates | 否 | {} | 设置追踪更新的UP主的ID)以及要推送的QQ群号,格式为{: [QQ群号1, QQ群号2, ...], ...}。注意全部号码都应为字符串,一个例子:{"823532": ["xxxxx", "yyyyy"]} |
| bnotifier_push_updates_by_group | 否 | {} | 作用同bnotifier_push_updates但格式为{QQ群: [BID1, BID2, ]},选择一个更适合你的方式即可 |
| bnotifier_push_lives | 否 | {} | 同bnotifier_push_updates但这个变量控制的是开播通知 |
| bnotifier_push_lives_by_group | 否 | {} | 格式同bnotifier_push_updates_by_group但这个变量控制的是开播通知 |
| bnotifier_push_type_blacklist | 否 | {} | 屏蔽推送某种动态信息,格式:{QQ群号或BID: ['DYNAMIC_TYPE_AV', 'DYNAMIC_TYPE_FORWARD', ...]}这样会屏蔽特定群/特定up的某种动态信息。关于动态种类请参考这个连接 |
其它配置为开发调试时使用,正常使用无需调整。
效果图
其它
有问题或新功能需求,请提issue。
Project details
Release history Release notifications | RSS feed
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-bilibili-notifier-0.0.3.tar.gz.
File metadata
- Download URL: nonebot-plugin-bilibili-notifier-0.0.3.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e86142a011ac2ff9a045933812e7b64ccc51b3e7dd43c175e40c8f4547d5f873
|
|
| MD5 |
c85ef788d1fd0d81539e678c551091ca
|
|
| BLAKE2b-256 |
40a372aa6074c49f5d1acbfe104143f42b9d7b09e09972c808606a84cdec0797
|
File details
Details for the file nonebot_plugin_bilibili_notifier-0.0.3-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_bilibili_notifier-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd29d12b5715b884e3a00a55de9dd7006e572fbd9b92a6dedb09a67c336d7b8a
|
|
| MD5 |
f39ddcd70bc36c81077f8395274f7195
|
|
| BLAKE2b-256 |
e2804611bac88c6e75e3f7a2b526b58e20c0eef1b62664444cba971b0c2e16fd
|