nonebot-plugin-bilidyn 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nonebot_plugin_bilidyn-0.3.0/LICENSE +21 -0
- nonebot_plugin_bilidyn-0.3.0/PKG-INFO +155 -0
- nonebot_plugin_bilidyn-0.3.0/README.md +129 -0
- nonebot_plugin_bilidyn-0.3.0/pyproject.toml +68 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/__init__.py +36 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/application/__init__.py +1 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/application/dynamic_collection.py +307 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/application/follow_sync.py +95 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/application/live_room_sync.py +40 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/__init__.py +7 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/group_cleanup.py +185 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/handlers/__init__.py +9 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/handlers/cleanup.py +63 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/handlers/dynamics.py +80 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/handlers/help.py +9 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/handlers/login.py +79 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/handlers/subscriptions.py +168 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/lifecycle.py +37 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/matcher.py +90 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/polling.py +406 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/scene.py +68 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/scheduler.py +75 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/bot/target_resolution.py +129 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/config.py +34 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/core/__init__.py +19 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/core/data_models.py +180 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/core/profile.py +190 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/dependencies.py +33 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/infra/__init__.py +5 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/infra/auth.py +154 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/infra/bili_client.py +145 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/infra/data_manager.py +445 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/infra/qr_login.py +49 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/policies.py +25 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/render/__init__.py +1052 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/render/downloader.py +68 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/render/messages.py +160 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/render/models.py +250 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/render/templates/dynamic_card.html.jinja +1335 -0
- nonebot_plugin_bilidyn-0.3.0/src/nonebot_plugin_bilidyn/render/templates/live_card.html.jinja +538 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Misty02600
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nonebot-plugin-bilidyn
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: NoneBot2 B站动态订阅推送插件
|
|
5
|
+
Author: Misty02600
|
|
6
|
+
Author-email: Misty02600 <Misty02600@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: bilibili-api-python>=17.0.0,<18.0.0
|
|
10
|
+
Requires-Dist: boltons>=25.0.0
|
|
11
|
+
Requires-Dist: msgspec>=0.19.0
|
|
12
|
+
Requires-Dist: nonebot-plugin-alconna>=0.60.0,<1.0.0
|
|
13
|
+
Requires-Dist: nonebot-plugin-apscheduler>=0.5.0,<1.0.0
|
|
14
|
+
Requires-Dist: nonebot-plugin-htmlrender>=0.3.0,<0.7.0
|
|
15
|
+
Requires-Dist: nonebot-plugin-localstore>=0.7.4,<1.0.0
|
|
16
|
+
Requires-Dist: nonebot-plugin-uniref>=0.4.1,<0.5.0
|
|
17
|
+
Requires-Dist: nonebot-plugin-uninfo>=0.7.0,<1.0.0
|
|
18
|
+
Requires-Dist: nonebot2>=2.4.2,<3.0.0
|
|
19
|
+
Requires-Dist: httpx
|
|
20
|
+
Requires-Dist: rapidfuzz>=3.14.3,<4.0.0
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Project-URL: Homepage, https://github.com/Misty02600/nonebot-plugin-bilidyn
|
|
23
|
+
Project-URL: Issues, https://github.com/Misty02600/nonebot-plugin-bilidyn/issues
|
|
24
|
+
Project-URL: Repository, https://github.com/Misty02600/nonebot-plugin-bilidyn.git
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
<div align="center">
|
|
28
|
+
<a href="https://v2.nonebot.dev/store">
|
|
29
|
+
<img src="https://github.com/Misty02600/nonebot-plugin-template/releases/download/assets/NoneBotPlugin.png" width="310" alt="logo"></a>
|
|
30
|
+
|
|
31
|
+
## ✨ nonebot-plugin-bilidyn ✨
|
|
32
|
+
[](./LICENSE)
|
|
33
|
+
[](https://www.python.org)
|
|
34
|
+
|
|
35
|
+
[](https://github.com/astral-sh/uv)
|
|
36
|
+
[](https://github.com/astral-sh/ruff)
|
|
37
|
+
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
## 📖 介绍
|
|
41
|
+
|
|
42
|
+
`nonebot-plugin-bilidyn` 是一个 NoneBot2 B 站动态订阅推送插件,支持订阅 UP 主动态、直播开播通知、二维码登录和主动查询最新动态。
|
|
43
|
+
|
|
44
|
+
插件当前基于 [bilibili-api-python](https://github.com/Nemo2011/bilibili-api) 异步拉取数据,并使用 [nonebot-plugin-localstore](https://github.com/nonebot/plugin-localstore) 管理缓存和持久化数据。
|
|
45
|
+
|
|
46
|
+
## 💿 安装
|
|
47
|
+
|
|
48
|
+
<details open>
|
|
49
|
+
<summary>使用 nb-cli 安装</summary>
|
|
50
|
+
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
|
|
51
|
+
|
|
52
|
+
nb plugin install nonebot-plugin-bilidyn --upgrade
|
|
53
|
+
使用 **pypi** 源安装
|
|
54
|
+
|
|
55
|
+
nb plugin install nonebot-plugin-bilidyn --upgrade -i "https://pypi.org/simple"
|
|
56
|
+
使用**清华源**安装
|
|
57
|
+
|
|
58
|
+
nb plugin install nonebot-plugin-bilidyn --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
</details>
|
|
62
|
+
|
|
63
|
+
<details>
|
|
64
|
+
<summary>使用包管理器安装</summary>
|
|
65
|
+
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
|
|
66
|
+
|
|
67
|
+
<details open>
|
|
68
|
+
<summary>uv</summary>
|
|
69
|
+
|
|
70
|
+
uv add nonebot-plugin-bilidyn
|
|
71
|
+
安装仓库 main 分支
|
|
72
|
+
|
|
73
|
+
uv add git+https://github.com/Misty02600/nonebot-plugin-bilidyn@main
|
|
74
|
+
</details>
|
|
75
|
+
|
|
76
|
+
<details>
|
|
77
|
+
<summary>pdm</summary>
|
|
78
|
+
|
|
79
|
+
pdm add nonebot-plugin-bilidyn
|
|
80
|
+
安装仓库 main 分支
|
|
81
|
+
|
|
82
|
+
pdm add git+https://github.com/Misty02600/nonebot-plugin-bilidyn@main
|
|
83
|
+
</details>
|
|
84
|
+
<details>
|
|
85
|
+
<summary>poetry</summary>
|
|
86
|
+
|
|
87
|
+
poetry add nonebot-plugin-bilidyn
|
|
88
|
+
安装仓库 main 分支
|
|
89
|
+
|
|
90
|
+
poetry add git+https://github.com/Misty02600/nonebot-plugin-bilidyn@main
|
|
91
|
+
</details>
|
|
92
|
+
|
|
93
|
+
打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入
|
|
94
|
+
|
|
95
|
+
plugins = ["nonebot_plugin_bilidyn"]
|
|
96
|
+
|
|
97
|
+
</details>
|
|
98
|
+
|
|
99
|
+
<details>
|
|
100
|
+
<summary>使用 nbr 安装(使用 uv 管理依赖可用)</summary>
|
|
101
|
+
|
|
102
|
+
[nbr](https://github.com/fllesser/nbr) 是一个基于 uv 的 nb-cli,可以方便地管理 nonebot2
|
|
103
|
+
|
|
104
|
+
nbr plugin install nonebot-plugin-bilidyn
|
|
105
|
+
使用 **pypi** 源安装
|
|
106
|
+
|
|
107
|
+
nbr plugin install nonebot-plugin-bilidyn -i "https://pypi.org/simple"
|
|
108
|
+
使用**清华源**安装
|
|
109
|
+
|
|
110
|
+
nbr plugin install nonebot-plugin-bilidyn -i "https://pypi.tuna.tsinghua.edu.cn/simple"
|
|
111
|
+
|
|
112
|
+
</details>
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
## ⚙️ 配置
|
|
116
|
+
|
|
117
|
+
插件使用 [nonebot_plugin_localstore](https://github.com/nonebot/plugin-localstore) 储存数据和缓存。
|
|
118
|
+
|
|
119
|
+
推荐使用 `bili login` 进行二维码登录。插件会把登录结果持久化到本地,后续重启会自动复用。
|
|
120
|
+
|
|
121
|
+
如需调整轮询或推送节奏,可在 NoneBot2 项目的 `.env` 文件中添加下列配置:
|
|
122
|
+
|
|
123
|
+
| 配置项 | 必填 | 默认值 | 说明 |
|
|
124
|
+
| :--------------------------------- | :---: | :------: | :-------------------------------------------------------------------- |
|
|
125
|
+
| `BILI_CHECK__DYNAMIC_MODE` | 否 | `per_up` | 动态来源:`per_up` 逐 UP 拉取;`follow_feed` 使用登录账号的聚合关注流 |
|
|
126
|
+
| `BILI_CHECK__DYNAMIC_INTERVAL` | 否 | `30` | 动态检测间隔,单位秒 |
|
|
127
|
+
| `BILI_CHECK__LIVE_INTERVAL` | 否 | `30` | 直播检测间隔,单位秒 |
|
|
128
|
+
| `BILI_CHECK__LOW_SPEED_START` | 否 | `1` | 低频时段起始小时 |
|
|
129
|
+
| `BILI_CHECK__LOW_SPEED_END` | 否 | `9` | 低频时段结束小时 |
|
|
130
|
+
| `BILI_CHECK__LOW_SPEED_MULTIPLIER` | 否 | `10` | 低频时段检测倍率 |
|
|
131
|
+
| `BILI_PUSH__PUSH_INTERVAL` | 否 | `0.5` | 连续推送间隔,单位秒 |
|
|
132
|
+
|
|
133
|
+
`per_up` 逐个拉取 UP 动态。`follow_feed` 会自动关注订阅的 UP,扫码换号后补齐关注,并从关注流筛选推送;没有有效登录凭据时暂停检测。
|
|
134
|
+
|
|
135
|
+
登录失效时,插件会向最后一次成功登录所在的私聊发送一次提醒。
|
|
136
|
+
|
|
137
|
+
## 🎉 使用
|
|
138
|
+
|
|
139
|
+
### 指令表
|
|
140
|
+
|
|
141
|
+
| 指令 | 权限 | 说明 |
|
|
142
|
+
| :------------------------------ | :----------------: | :----------------------------------------------- |
|
|
143
|
+
| `bili` / `bili help` | 无 | 查看帮助文本 |
|
|
144
|
+
| `bili sub <UID>` | 私聊 / 管理 / 超管 | 为当前会话订阅指定 UP 主 |
|
|
145
|
+
| `bili unsub <UID / 名称>` | 私聊 / 管理 / 超管 | 取消当前会话对指定 UP 主的订阅 |
|
|
146
|
+
| `bili list` | 无 | 查看当前会话订阅列表 |
|
|
147
|
+
| `bili clear [confirm]` | 超管 | 扫描当前已失效的群推送配置,并在确认后批量清理 |
|
|
148
|
+
| `bili login` | 私聊, 超管 | 发起二维码登录,并自动轮询扫码结果 |
|
|
149
|
+
| `bili new <UID / 名称> [count]` | 无 | 主动查看某位 UP 主最近动态,默认 1 条,最多 5 条 |
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
### 🎨 效果图
|
|
153
|
+
|
|
154
|
+
- 动态卡片
|
|
155
|
+
- 直播卡片
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://v2.nonebot.dev/store">
|
|
3
|
+
<img src="https://github.com/Misty02600/nonebot-plugin-template/releases/download/assets/NoneBotPlugin.png" width="310" alt="logo"></a>
|
|
4
|
+
|
|
5
|
+
## ✨ nonebot-plugin-bilidyn ✨
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
[](https://www.python.org)
|
|
8
|
+
|
|
9
|
+
[](https://github.com/astral-sh/uv)
|
|
10
|
+
[](https://github.com/astral-sh/ruff)
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
## 📖 介绍
|
|
15
|
+
|
|
16
|
+
`nonebot-plugin-bilidyn` 是一个 NoneBot2 B 站动态订阅推送插件,支持订阅 UP 主动态、直播开播通知、二维码登录和主动查询最新动态。
|
|
17
|
+
|
|
18
|
+
插件当前基于 [bilibili-api-python](https://github.com/Nemo2011/bilibili-api) 异步拉取数据,并使用 [nonebot-plugin-localstore](https://github.com/nonebot/plugin-localstore) 管理缓存和持久化数据。
|
|
19
|
+
|
|
20
|
+
## 💿 安装
|
|
21
|
+
|
|
22
|
+
<details open>
|
|
23
|
+
<summary>使用 nb-cli 安装</summary>
|
|
24
|
+
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
|
|
25
|
+
|
|
26
|
+
nb plugin install nonebot-plugin-bilidyn --upgrade
|
|
27
|
+
使用 **pypi** 源安装
|
|
28
|
+
|
|
29
|
+
nb plugin install nonebot-plugin-bilidyn --upgrade -i "https://pypi.org/simple"
|
|
30
|
+
使用**清华源**安装
|
|
31
|
+
|
|
32
|
+
nb plugin install nonebot-plugin-bilidyn --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
</details>
|
|
36
|
+
|
|
37
|
+
<details>
|
|
38
|
+
<summary>使用包管理器安装</summary>
|
|
39
|
+
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
|
|
40
|
+
|
|
41
|
+
<details open>
|
|
42
|
+
<summary>uv</summary>
|
|
43
|
+
|
|
44
|
+
uv add nonebot-plugin-bilidyn
|
|
45
|
+
安装仓库 main 分支
|
|
46
|
+
|
|
47
|
+
uv add git+https://github.com/Misty02600/nonebot-plugin-bilidyn@main
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
<details>
|
|
51
|
+
<summary>pdm</summary>
|
|
52
|
+
|
|
53
|
+
pdm add nonebot-plugin-bilidyn
|
|
54
|
+
安装仓库 main 分支
|
|
55
|
+
|
|
56
|
+
pdm add git+https://github.com/Misty02600/nonebot-plugin-bilidyn@main
|
|
57
|
+
</details>
|
|
58
|
+
<details>
|
|
59
|
+
<summary>poetry</summary>
|
|
60
|
+
|
|
61
|
+
poetry add nonebot-plugin-bilidyn
|
|
62
|
+
安装仓库 main 分支
|
|
63
|
+
|
|
64
|
+
poetry add git+https://github.com/Misty02600/nonebot-plugin-bilidyn@main
|
|
65
|
+
</details>
|
|
66
|
+
|
|
67
|
+
打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入
|
|
68
|
+
|
|
69
|
+
plugins = ["nonebot_plugin_bilidyn"]
|
|
70
|
+
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
<details>
|
|
74
|
+
<summary>使用 nbr 安装(使用 uv 管理依赖可用)</summary>
|
|
75
|
+
|
|
76
|
+
[nbr](https://github.com/fllesser/nbr) 是一个基于 uv 的 nb-cli,可以方便地管理 nonebot2
|
|
77
|
+
|
|
78
|
+
nbr plugin install nonebot-plugin-bilidyn
|
|
79
|
+
使用 **pypi** 源安装
|
|
80
|
+
|
|
81
|
+
nbr plugin install nonebot-plugin-bilidyn -i "https://pypi.org/simple"
|
|
82
|
+
使用**清华源**安装
|
|
83
|
+
|
|
84
|
+
nbr plugin install nonebot-plugin-bilidyn -i "https://pypi.tuna.tsinghua.edu.cn/simple"
|
|
85
|
+
|
|
86
|
+
</details>
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## ⚙️ 配置
|
|
90
|
+
|
|
91
|
+
插件使用 [nonebot_plugin_localstore](https://github.com/nonebot/plugin-localstore) 储存数据和缓存。
|
|
92
|
+
|
|
93
|
+
推荐使用 `bili login` 进行二维码登录。插件会把登录结果持久化到本地,后续重启会自动复用。
|
|
94
|
+
|
|
95
|
+
如需调整轮询或推送节奏,可在 NoneBot2 项目的 `.env` 文件中添加下列配置:
|
|
96
|
+
|
|
97
|
+
| 配置项 | 必填 | 默认值 | 说明 |
|
|
98
|
+
| :--------------------------------- | :---: | :------: | :-------------------------------------------------------------------- |
|
|
99
|
+
| `BILI_CHECK__DYNAMIC_MODE` | 否 | `per_up` | 动态来源:`per_up` 逐 UP 拉取;`follow_feed` 使用登录账号的聚合关注流 |
|
|
100
|
+
| `BILI_CHECK__DYNAMIC_INTERVAL` | 否 | `30` | 动态检测间隔,单位秒 |
|
|
101
|
+
| `BILI_CHECK__LIVE_INTERVAL` | 否 | `30` | 直播检测间隔,单位秒 |
|
|
102
|
+
| `BILI_CHECK__LOW_SPEED_START` | 否 | `1` | 低频时段起始小时 |
|
|
103
|
+
| `BILI_CHECK__LOW_SPEED_END` | 否 | `9` | 低频时段结束小时 |
|
|
104
|
+
| `BILI_CHECK__LOW_SPEED_MULTIPLIER` | 否 | `10` | 低频时段检测倍率 |
|
|
105
|
+
| `BILI_PUSH__PUSH_INTERVAL` | 否 | `0.5` | 连续推送间隔,单位秒 |
|
|
106
|
+
|
|
107
|
+
`per_up` 逐个拉取 UP 动态。`follow_feed` 会自动关注订阅的 UP,扫码换号后补齐关注,并从关注流筛选推送;没有有效登录凭据时暂停检测。
|
|
108
|
+
|
|
109
|
+
登录失效时,插件会向最后一次成功登录所在的私聊发送一次提醒。
|
|
110
|
+
|
|
111
|
+
## 🎉 使用
|
|
112
|
+
|
|
113
|
+
### 指令表
|
|
114
|
+
|
|
115
|
+
| 指令 | 权限 | 说明 |
|
|
116
|
+
| :------------------------------ | :----------------: | :----------------------------------------------- |
|
|
117
|
+
| `bili` / `bili help` | 无 | 查看帮助文本 |
|
|
118
|
+
| `bili sub <UID>` | 私聊 / 管理 / 超管 | 为当前会话订阅指定 UP 主 |
|
|
119
|
+
| `bili unsub <UID / 名称>` | 私聊 / 管理 / 超管 | 取消当前会话对指定 UP 主的订阅 |
|
|
120
|
+
| `bili list` | 无 | 查看当前会话订阅列表 |
|
|
121
|
+
| `bili clear [confirm]` | 超管 | 扫描当前已失效的群推送配置,并在确认后批量清理 |
|
|
122
|
+
| `bili login` | 私聊, 超管 | 发起二维码登录,并自动轮询扫码结果 |
|
|
123
|
+
| `bili new <UID / 名称> [count]` | 无 | 主动查看某位 UP 主最近动态,默认 1 条,最多 5 条 |
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### 🎨 效果图
|
|
127
|
+
|
|
128
|
+
- 动态卡片
|
|
129
|
+
- 直播卡片
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "nonebot-plugin-bilidyn"
|
|
3
|
+
version = "0.3.0"
|
|
4
|
+
description = "NoneBot2 B站动态订阅推送插件"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.11"
|
|
9
|
+
authors = [{ name = "Misty02600", email = "Misty02600@gmail.com" }]
|
|
10
|
+
dependencies = [
|
|
11
|
+
"bilibili-api-python>=17.0.0,<18.0.0",
|
|
12
|
+
"boltons>=25.0.0",
|
|
13
|
+
"msgspec>=0.19.0",
|
|
14
|
+
"nonebot-plugin-alconna>=0.60.0,<1.0.0",
|
|
15
|
+
"nonebot-plugin-apscheduler>=0.5.0,<1.0.0",
|
|
16
|
+
"nonebot-plugin-htmlrender>=0.3.0,<0.7.0",
|
|
17
|
+
"nonebot-plugin-localstore>=0.7.4,<1.0.0",
|
|
18
|
+
"nonebot-plugin-uniref>=0.4.1,<0.5.0",
|
|
19
|
+
"nonebot-plugin-uninfo>=0.7.0,<1.0.0",
|
|
20
|
+
"nonebot2>=2.4.2,<3.0.0",
|
|
21
|
+
"httpx",
|
|
22
|
+
"rapidfuzz>=3.14.3,<4.0.0",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://github.com/Misty02600/nonebot-plugin-bilidyn"
|
|
27
|
+
Issues = "https://github.com/Misty02600/nonebot-plugin-bilidyn/issues"
|
|
28
|
+
Repository = "https://github.com/Misty02600/nonebot-plugin-bilidyn.git"
|
|
29
|
+
|
|
30
|
+
[dependency-groups]
|
|
31
|
+
dev = [
|
|
32
|
+
"commitizen>=4.1.0,<5.0.0",
|
|
33
|
+
"git-cliff>=2.11.0,<3.0.0",
|
|
34
|
+
"nb-cli>=1.7.0,<2.0.0",
|
|
35
|
+
"prek>=0.2.0,<1.0.0",
|
|
36
|
+
{ include-group = "lint" },
|
|
37
|
+
{ include-group = "test" },
|
|
38
|
+
{ include-group = "type" },
|
|
39
|
+
]
|
|
40
|
+
lint = [
|
|
41
|
+
"ruff>=0.14.13,<1.0.0",
|
|
42
|
+
]
|
|
43
|
+
test = [
|
|
44
|
+
"pytest>=9.0.0,<10.0.0",
|
|
45
|
+
"nonebot-adapter-onebot>=2.4.6,<3.0.0",
|
|
46
|
+
"nonebot2[fastapi]>=2.4.4,<3.0.0",
|
|
47
|
+
"nonebug>=0.4.3,<1.0.0",
|
|
48
|
+
"pytest-asyncio>=1.3.0,<1.4.0",
|
|
49
|
+
]
|
|
50
|
+
type = [
|
|
51
|
+
"basedpyright>=1.16.0,<2.0.0",
|
|
52
|
+
"nonebot-adapter-onebot>=2.4.6,<3.0.0",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[tool.nonebot.plugins]
|
|
56
|
+
nonebot-plugin-bilidyn = ["nonebot_plugin_bilidyn"]
|
|
57
|
+
|
|
58
|
+
[tool.nonebot.adapters]
|
|
59
|
+
nonebot-adapter-onebot = [
|
|
60
|
+
{ name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11" },
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
[build-system]
|
|
64
|
+
requires = ["uv_build>=0.10.0,<0.12.0"]
|
|
65
|
+
build-backend = "uv_build"
|
|
66
|
+
|
|
67
|
+
[tool.uv.build-backend]
|
|
68
|
+
module-name = "nonebot_plugin_bilidyn"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from nonebot import require
|
|
2
|
+
from nonebot.plugin import PluginMetadata, inherit_supported_adapters
|
|
3
|
+
|
|
4
|
+
require("nonebot_plugin_alconna")
|
|
5
|
+
require("nonebot_plugin_apscheduler")
|
|
6
|
+
require("nonebot_plugin_htmlrender")
|
|
7
|
+
require("nonebot_plugin_localstore")
|
|
8
|
+
require("nonebot_plugin_uninfo")
|
|
9
|
+
require("nonebot_plugin_uniref")
|
|
10
|
+
|
|
11
|
+
USAGE_TEXT = (
|
|
12
|
+
"bili sub <UID> - 订阅 UP 主\n"
|
|
13
|
+
"bili unsub <UID> - 取消当前场景内订阅\n"
|
|
14
|
+
"bili list - 查看订阅列表\n"
|
|
15
|
+
"bili new <UID> [count] - 查看最新动态"
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
from . import bot as bot
|
|
19
|
+
from .config import Config
|
|
20
|
+
|
|
21
|
+
__all__ = ("USAGE_TEXT", "__plugin_meta__", "bot")
|
|
22
|
+
|
|
23
|
+
__plugin_meta__ = PluginMetadata(
|
|
24
|
+
name="B站动态订阅",
|
|
25
|
+
description="订阅B站UP主动态和直播通知推送",
|
|
26
|
+
usage=USAGE_TEXT,
|
|
27
|
+
type="application",
|
|
28
|
+
homepage="https://github.com/Misty02600/nonebot-plugin-bilidyn",
|
|
29
|
+
config=Config,
|
|
30
|
+
supported_adapters=inherit_supported_adapters(
|
|
31
|
+
"nonebot_plugin_alconna",
|
|
32
|
+
"nonebot_plugin_uninfo",
|
|
33
|
+
"nonebot_plugin_uniref",
|
|
34
|
+
),
|
|
35
|
+
extra={"author": "Misty02600 <Misty02600@gmail.com>"},
|
|
36
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""应用用例。"""
|