Skip to main content

NoneBot2 plugin for Bilibili update and live notifications

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-bilibili-notifier

✨ B站UP的更新与开播通知机 ✨

license pypi python

📖 介绍

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主。

然后导出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(点击主页后地址中显示的space.bilibili.com/[这个号码])以及要推送的QQ群号,格式为{UP1: [QQ群1, QQ群2, ...], ...}。注意全部号码都应为字符串,一个例子:{"823532": ["xxxxx", "yyyyy"]}
bnotifier_push_lives 同bnotifier_push_updates但这个变量控制的是开播通知

其它配置为开发调试时使用,正常使用无需调整。

效果图

Notifier Demo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot-plugin-bilibili-notifier-0.0.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file nonebot-plugin-bilibili-notifier-0.0.1.tar.gz.

File metadata

File hashes

Hashes for nonebot-plugin-bilibili-notifier-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e787339b340c296e07e3ff35ca9ea600cebbb3e9e37b6a8fccb506be0aafd375
MD5 8ef4e39a3d9930c56a4e1d8949c902b3
BLAKE2b-256 855f2f7cabf522756d8f22f238061cb9fab9d27d2d79c0a7dc4b0c6f4a1bec52

See more details on using hashes here.

File details

Details for the file nonebot_plugin_bilibili_notifier-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_bilibili_notifier-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c7df5e781488b3abda7b17215ef7e43526f35d611edda861a398d7737deefef
MD5 80b6036f3a0d8996ad65f85ce17cac11
BLAKE2b-256 9d4e108de1dd7f3ee1f0e687c310c5ff0d9d4547e62e114843c8c80862ff3e5d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page