nonebot-plugin-ifollow 1.0.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.
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.3
2
+ Name: nonebot-plugin-ifollow
3
+ Version: 1.0.0
4
+ Summary: NoneBot2 多平台作者更新订阅插件
5
+ Author: ByteColtX
6
+ Author-email: ByteColtX <umk@live.com>
7
+ Requires-Dist: httpx>=0.27.0,<1.0.0
8
+ Requires-Dist: nonebot-adapter-onebot>=2.4.6,<3.0.0
9
+ Requires-Dist: nonebot-plugin-alconna>=0.60.0,<1.0.0
10
+ Requires-Dist: nonebot-plugin-apscheduler>=0.5.0,<1.0.0
11
+ Requires-Dist: nonebot-plugin-localstore>=0.7.4,<1.0.0
12
+ Requires-Dist: nonebot-plugin-parser>=2.6.8,<3.0.0
13
+ Requires-Dist: nonebot2>=2.5.0,<3.0.0
14
+ Requires-Python: >=3.10
15
+ Project-URL: Homepage, https://github.com/ByteColtX/nonebot-plugin-ifollow
16
+ Project-URL: Issues, https://github.com/ByteColtX/nonebot-plugin-ifollow/issues
17
+ Project-URL: Repository, https://github.com/ByteColtX/nonebot-plugin-ifollow.git
18
+ Description-Content-Type: text/markdown
19
+
20
+ <div align="center">
21
+ <a href="https://v2.nonebot.dev/store">
22
+ <img src="https://raw.githubusercontent.com/nonebot/nonebot2/master/.docs/NoneBotPlugin.svg" width="310" alt="logo"></a>
23
+
24
+ ## ✨ nonebot-plugin-douyin-subscribe ✨
25
+ [![LICENSE](https://img.shields.io/github/license/ByteColtX/nonebot-plugin-ifollow.svg)](./LICENSE)
26
+ [![pypi](https://img.shields.io/pypi/v/nonebot-plugin-ifollow.svg)](https://pypi.org/project/nonebot-plugin-ifollow/)
27
+ [![python](https://img.shields.io/badge/python-3.10|3.11|3.12|3.13|3.14-blue.svg)](https://www.python.org)
28
+ [![uv](https://img.shields.io/badge/package%20manager-uv-black?style=flat-square&logo=uv)](https://github.com/astral-sh/uv)
29
+ <br/>
30
+ [![ruff](https://img.shields.io/badge/code%20style-ruff-black?style=flat-square&logo=ruff)](https://github.com/astral-sh/ruff)
31
+ [![pre-commit](https://results.pre-commit.ci/badge/github/ByteColtX/nonebot-plugin-douyin-subscribe/master.svg)](https://results.pre-commit.ci/latest/github/ByteColtX/nonebot-plugin-douyin-subscribe/master)
32
+
33
+ </div>
34
+
35
+ ## 📖 介绍
36
+
37
+ 订阅抖音和 B 站作者的新作品及动态,并将作品分享链接交给
38
+ [nonebot-plugin-parser](https://github.com/fllesser/nonebot-plugin-parser) 下载和发送。
39
+ 支持抖音作者主页链接、作者主页短链、`sec_user_id`,以及 B 站作者主页和作品链接,
40
+ 每个会话独立记录已发送作品。
41
+
42
+ ## 💿 安装
43
+
44
+ <details open>
45
+ <summary>使用 nb-cli 安装</summary>
46
+ 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
47
+
48
+ nb plugin install nonebot-plugin-ifollow --upgrade
49
+ 使用 **pypi** 源安装
50
+
51
+ nb plugin install nonebot-plugin-ifollow --upgrade -i "https://pypi.org/simple"
52
+ 使用**清华源**安装
53
+
54
+ nb plugin install nonebot-plugin-ifollow --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
55
+
56
+
57
+ </details>
58
+
59
+ <details>
60
+ <summary>使用包管理器安装</summary>
61
+ 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
62
+
63
+ <details open>
64
+ <summary>uv</summary>
65
+
66
+ uv add nonebot-plugin-ifollow
67
+ 安装仓库 master 分支
68
+
69
+ uv add git+https://github.com/ByteColtX/nonebot-plugin-ifollow@master
70
+ </details>
71
+
72
+ <details>
73
+ <summary>pdm</summary>
74
+
75
+ pdm add nonebot-plugin-ifollow
76
+ 安装仓库 master 分支
77
+
78
+ pdm add git+https://github.com/ByteColtX/nonebot-plugin-ifollow@master
79
+ </details>
80
+ <details>
81
+ <summary>poetry</summary>
82
+
83
+ poetry add nonebot-plugin-ifollow
84
+ 安装仓库 master 分支
85
+
86
+ poetry add git+https://github.com/ByteColtX/nonebot-plugin-ifollow@master
87
+ </details>
88
+
89
+ 打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入
90
+
91
+ plugins = ["nonebot_plugin_ifollow"]
92
+
93
+ </details>
94
+
95
+ <details>
96
+ <summary>使用 nbr 安装(使用 uv 管理依赖可用)</summary>
97
+
98
+ [nbr](https://github.com/fllesser/nbr) 是一个基于 uv 的 nb-cli,可以方便地管理 nonebot2
99
+
100
+ nbr plugin install nonebot-plugin-ifollow
101
+ 使用 **pypi** 源安装
102
+
103
+ nbr plugin install nonebot-plugin-ifollow -i "https://pypi.org/simple"
104
+ 使用**清华源**安装
105
+
106
+ nbr plugin install nonebot-plugin-ifollow -i "https://pypi.tuna.tsinghua.edu.cn/simple"
107
+
108
+ </details>
109
+
110
+
111
+ ## ⚙️ 配置
112
+
113
+ 在 nonebot2 项目的`.env`文件中添加下表中的可选配置。平台网页接口可能随时调整,接口受限时可配置有效 Cookie。
114
+
115
+ | 配置项 | 必填 | 默认值 | 说明 |
116
+ | :--- | :---: | :---: | :--- |
117
+ | `IFOLLOW_SUBSCRIBE_INTERVAL` | 否 | `300` | 所有平台共享的轮询间隔,单位为秒,最小 30 秒 |
118
+ | `IFOLLOW_SUBSCRIBE_COUNT` | 否 | `20` | 每个平台每次拉取的最新内容数,范围 1-50 |
119
+ | `IFOLLOW_DOUYIN_COOKIE` | 否 | 无 | 抖音网页 Cookie,接口受限时填写 |
120
+ | `IFOLLOW_BILIBILI_COOKIE` | 否 | 无 | B 站 Cookie,接口或视频下载受限时填写 |
121
+
122
+ 示例:
123
+
124
+ ```dotenv
125
+ IFOLLOW_SUBSCRIBE_INTERVAL=300
126
+ IFOLLOW_SUBSCRIBE_COUNT=20
127
+ IFOLLOW_DOUYIN_COOKIE="你的抖音网页 Cookie"
128
+ IFOLLOW_BILIBILI_COOKIE="你的 B 站 Cookie"
129
+ ```
130
+
131
+ 插件依赖 `nonebot-plugin-parser` 发送视频,parser 的视频解析还需要安装 ffmpeg。订阅数据由
132
+ `nonebot-plugin-localstore` 持久化到插件数据目录,不要把 Cookie 或订阅数据提交到代码仓库。
133
+
134
+ ## 🎉 使用
135
+
136
+ ### 指令表
137
+
138
+ | 指令 | 权限 | 需要@ | 范围 | 说明 |
139
+ | :--- | :--- | :--- | :--- | :--- |
140
+ | `爱播帮助` | 群员 | 否 | 群聊、私聊 | 查看帮助 |
141
+ | `爱播订阅 <作者主页或作品链接>` | 群员 | 否 | 群聊、私聊 | 订阅一个抖音或 B 站作者 |
142
+ | `爱播订阅列表` | 群员 | 否 | 群聊、私聊 | 查看当前会话的订阅 |
143
+ | `爱播取消订阅 <序号或作者主页/作品链接>` | 群员 | 否 | 群聊、私聊 | 取消一个作者订阅 |
144
+
145
+ ### 订阅作者
146
+
147
+ ```text
148
+ 爱播订阅 https://www.douyin.com/user/MS4wLjABAAAA...
149
+ 爱播订阅 https://v.douyin.com/作者主页短链/
150
+ 爱播订阅 MS4wLjABAAAA...
151
+ 爱播订阅 https://space.bilibili.com/123456
152
+ 爱播订阅 https://www.bilibili.com/video/BV1xxxxxxxxx
153
+ ```
154
+
155
+ 也可以引用包含抖音或 B 站作品分享链接的消息后发送 `爱播订阅`。插件会读取被引用的原消息,
156
+ 从作品页解析作者主页并完成订阅;该功能需要当前适配器支持 `get_msg` 接口。
157
+
158
+ ```text
159
+ 群友A:4.38 复制打开抖音,看看【小葵日记的作品】喵喵喵 https://v.douyin.com/0l0Sigjl5jM/
160
+ 群友A(引用上一条消息):爱播订阅
161
+ ```
162
+
163
+ 首次订阅只记录当前最新作品或动态,不会补发历史内容。之后轮询发现新内容时,插件会将作品链接交给
164
+ `nonebot-plugin-parser` 下载并发送到订阅会话。
165
+
166
+ ### 管理订阅
167
+
168
+ ```text
169
+ 爱播订阅列表
170
+ 爱播取消订阅 https://www.douyin.com/user/MS4wLjABAAAA...
171
+ ```
172
+
173
+ 订阅状态按平台、作者和目标会话保存;同一个作者可以订阅到多个会话,各会话分别记录推送游标。
174
+
175
+ ### 🎨 效果图
176
+
177
+ 暂无示例图。
@@ -0,0 +1,158 @@
1
+ <div align="center">
2
+ <a href="https://v2.nonebot.dev/store">
3
+ <img src="https://raw.githubusercontent.com/nonebot/nonebot2/master/.docs/NoneBotPlugin.svg" width="310" alt="logo"></a>
4
+
5
+ ## ✨ nonebot-plugin-douyin-subscribe ✨
6
+ [![LICENSE](https://img.shields.io/github/license/ByteColtX/nonebot-plugin-ifollow.svg)](./LICENSE)
7
+ [![pypi](https://img.shields.io/pypi/v/nonebot-plugin-ifollow.svg)](https://pypi.org/project/nonebot-plugin-ifollow/)
8
+ [![python](https://img.shields.io/badge/python-3.10|3.11|3.12|3.13|3.14-blue.svg)](https://www.python.org)
9
+ [![uv](https://img.shields.io/badge/package%20manager-uv-black?style=flat-square&logo=uv)](https://github.com/astral-sh/uv)
10
+ <br/>
11
+ [![ruff](https://img.shields.io/badge/code%20style-ruff-black?style=flat-square&logo=ruff)](https://github.com/astral-sh/ruff)
12
+ [![pre-commit](https://results.pre-commit.ci/badge/github/ByteColtX/nonebot-plugin-douyin-subscribe/master.svg)](https://results.pre-commit.ci/latest/github/ByteColtX/nonebot-plugin-douyin-subscribe/master)
13
+
14
+ </div>
15
+
16
+ ## 📖 介绍
17
+
18
+ 订阅抖音和 B 站作者的新作品及动态,并将作品分享链接交给
19
+ [nonebot-plugin-parser](https://github.com/fllesser/nonebot-plugin-parser) 下载和发送。
20
+ 支持抖音作者主页链接、作者主页短链、`sec_user_id`,以及 B 站作者主页和作品链接,
21
+ 每个会话独立记录已发送作品。
22
+
23
+ ## 💿 安装
24
+
25
+ <details open>
26
+ <summary>使用 nb-cli 安装</summary>
27
+ 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
28
+
29
+ nb plugin install nonebot-plugin-ifollow --upgrade
30
+ 使用 **pypi** 源安装
31
+
32
+ nb plugin install nonebot-plugin-ifollow --upgrade -i "https://pypi.org/simple"
33
+ 使用**清华源**安装
34
+
35
+ nb plugin install nonebot-plugin-ifollow --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
36
+
37
+
38
+ </details>
39
+
40
+ <details>
41
+ <summary>使用包管理器安装</summary>
42
+ 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
43
+
44
+ <details open>
45
+ <summary>uv</summary>
46
+
47
+ uv add nonebot-plugin-ifollow
48
+ 安装仓库 master 分支
49
+
50
+ uv add git+https://github.com/ByteColtX/nonebot-plugin-ifollow@master
51
+ </details>
52
+
53
+ <details>
54
+ <summary>pdm</summary>
55
+
56
+ pdm add nonebot-plugin-ifollow
57
+ 安装仓库 master 分支
58
+
59
+ pdm add git+https://github.com/ByteColtX/nonebot-plugin-ifollow@master
60
+ </details>
61
+ <details>
62
+ <summary>poetry</summary>
63
+
64
+ poetry add nonebot-plugin-ifollow
65
+ 安装仓库 master 分支
66
+
67
+ poetry add git+https://github.com/ByteColtX/nonebot-plugin-ifollow@master
68
+ </details>
69
+
70
+ 打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入
71
+
72
+ plugins = ["nonebot_plugin_ifollow"]
73
+
74
+ </details>
75
+
76
+ <details>
77
+ <summary>使用 nbr 安装(使用 uv 管理依赖可用)</summary>
78
+
79
+ [nbr](https://github.com/fllesser/nbr) 是一个基于 uv 的 nb-cli,可以方便地管理 nonebot2
80
+
81
+ nbr plugin install nonebot-plugin-ifollow
82
+ 使用 **pypi** 源安装
83
+
84
+ nbr plugin install nonebot-plugin-ifollow -i "https://pypi.org/simple"
85
+ 使用**清华源**安装
86
+
87
+ nbr plugin install nonebot-plugin-ifollow -i "https://pypi.tuna.tsinghua.edu.cn/simple"
88
+
89
+ </details>
90
+
91
+
92
+ ## ⚙️ 配置
93
+
94
+ 在 nonebot2 项目的`.env`文件中添加下表中的可选配置。平台网页接口可能随时调整,接口受限时可配置有效 Cookie。
95
+
96
+ | 配置项 | 必填 | 默认值 | 说明 |
97
+ | :--- | :---: | :---: | :--- |
98
+ | `IFOLLOW_SUBSCRIBE_INTERVAL` | 否 | `300` | 所有平台共享的轮询间隔,单位为秒,最小 30 秒 |
99
+ | `IFOLLOW_SUBSCRIBE_COUNT` | 否 | `20` | 每个平台每次拉取的最新内容数,范围 1-50 |
100
+ | `IFOLLOW_DOUYIN_COOKIE` | 否 | 无 | 抖音网页 Cookie,接口受限时填写 |
101
+ | `IFOLLOW_BILIBILI_COOKIE` | 否 | 无 | B 站 Cookie,接口或视频下载受限时填写 |
102
+
103
+ 示例:
104
+
105
+ ```dotenv
106
+ IFOLLOW_SUBSCRIBE_INTERVAL=300
107
+ IFOLLOW_SUBSCRIBE_COUNT=20
108
+ IFOLLOW_DOUYIN_COOKIE="你的抖音网页 Cookie"
109
+ IFOLLOW_BILIBILI_COOKIE="你的 B 站 Cookie"
110
+ ```
111
+
112
+ 插件依赖 `nonebot-plugin-parser` 发送视频,parser 的视频解析还需要安装 ffmpeg。订阅数据由
113
+ `nonebot-plugin-localstore` 持久化到插件数据目录,不要把 Cookie 或订阅数据提交到代码仓库。
114
+
115
+ ## 🎉 使用
116
+
117
+ ### 指令表
118
+
119
+ | 指令 | 权限 | 需要@ | 范围 | 说明 |
120
+ | :--- | :--- | :--- | :--- | :--- |
121
+ | `爱播帮助` | 群员 | 否 | 群聊、私聊 | 查看帮助 |
122
+ | `爱播订阅 <作者主页或作品链接>` | 群员 | 否 | 群聊、私聊 | 订阅一个抖音或 B 站作者 |
123
+ | `爱播订阅列表` | 群员 | 否 | 群聊、私聊 | 查看当前会话的订阅 |
124
+ | `爱播取消订阅 <序号或作者主页/作品链接>` | 群员 | 否 | 群聊、私聊 | 取消一个作者订阅 |
125
+
126
+ ### 订阅作者
127
+
128
+ ```text
129
+ 爱播订阅 https://www.douyin.com/user/MS4wLjABAAAA...
130
+ 爱播订阅 https://v.douyin.com/作者主页短链/
131
+ 爱播订阅 MS4wLjABAAAA...
132
+ 爱播订阅 https://space.bilibili.com/123456
133
+ 爱播订阅 https://www.bilibili.com/video/BV1xxxxxxxxx
134
+ ```
135
+
136
+ 也可以引用包含抖音或 B 站作品分享链接的消息后发送 `爱播订阅`。插件会读取被引用的原消息,
137
+ 从作品页解析作者主页并完成订阅;该功能需要当前适配器支持 `get_msg` 接口。
138
+
139
+ ```text
140
+ 群友A:4.38 复制打开抖音,看看【小葵日记的作品】喵喵喵 https://v.douyin.com/0l0Sigjl5jM/
141
+ 群友A(引用上一条消息):爱播订阅
142
+ ```
143
+
144
+ 首次订阅只记录当前最新作品或动态,不会补发历史内容。之后轮询发现新内容时,插件会将作品链接交给
145
+ `nonebot-plugin-parser` 下载并发送到订阅会话。
146
+
147
+ ### 管理订阅
148
+
149
+ ```text
150
+ 爱播订阅列表
151
+ 爱播取消订阅 https://www.douyin.com/user/MS4wLjABAAAA...
152
+ ```
153
+
154
+ 订阅状态按平台、作者和目标会话保存;同一个作者可以订阅到多个会话,各会话分别记录推送游标。
155
+
156
+ ### 🎨 效果图
157
+
158
+ 暂无示例图。
@@ -0,0 +1,107 @@
1
+ [project]
2
+ name = "nonebot-plugin-ifollow"
3
+ version = "1.0.0"
4
+ description = "NoneBot2 多平台作者更新订阅插件"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ dependencies = [
8
+ "httpx>=0.27.0,<1.0.0",
9
+ "nonebot-adapter-onebot>=2.4.6,<3.0.0",
10
+ "nonebot-plugin-alconna>=0.60.0,<1.0.0",
11
+ "nonebot-plugin-apscheduler>=0.5.0,<1.0.0",
12
+ "nonebot-plugin-localstore>=0.7.4,<1.0.0",
13
+ "nonebot-plugin-parser>=2.6.8,<3.0.0",
14
+ "nonebot2>=2.5.0,<3.0.0",
15
+ ]
16
+
17
+ [[project.authors]]
18
+ name = "ByteColtX"
19
+ email = "umk@live.com"
20
+
21
+ [project.urls]
22
+ Homepage = "https://github.com/ByteColtX/nonebot-plugin-ifollow"
23
+ Issues = "https://github.com/ByteColtX/nonebot-plugin-ifollow/issues"
24
+ Repository = "https://github.com/ByteColtX/nonebot-plugin-ifollow.git"
25
+
26
+ [dependency-groups]
27
+ dev = [
28
+ "basedpyright>=1.31.0,<2.0.0",
29
+ "bump-my-version>=1.2.7",
30
+ "nonebot2[fastapi]>=2.5.0,<3.0.0",
31
+ "poethepoet>=0.42.1",
32
+ "pytest>=9.0.2,<10.0.0",
33
+ "pytest-asyncio>=1.3.0,<1.4.0",
34
+ "pytest-cov>=7.0.0",
35
+ "pytest-xdist>=3.8.0,<4.0.0",
36
+ "ruff>=0.15.2,<1.0.0",
37
+ ]
38
+
39
+ [build-system]
40
+ requires = ["uv_build>=0.10.0,<0.13.0"]
41
+ build-backend = "uv_build"
42
+
43
+ [tool.nonebot]
44
+ plugins = ["nonebot_plugin_ifollow"]
45
+
46
+ [tool.poe.tasks]
47
+ test = "pytest --cov=src --cov-report=xml --junitxml=./junit.xml -n auto"
48
+ bump = "bump-my-version bump"
49
+ show-bump = "bump-my-version show-bump"
50
+
51
+ [tool.bumpversion]
52
+ current_version = "0.1.0"
53
+ commit = true
54
+ message = "release: 将版本从 {current_version} 更新至 {new_version}"
55
+ tag = true
56
+
57
+ [[tool.bumpversion.files]]
58
+ filename = "uv.lock"
59
+ search = """
60
+ name = "nonebot-plugin-ifollow"
61
+ version = "{current_version}""""
62
+ replace = """
63
+ name = "nonebot-plugin-ifollow"
64
+ version = "{new_version}""""
65
+
66
+ [tool.pytest]
67
+ pythonpath = [
68
+ "src",
69
+ "tests",
70
+ ]
71
+ asyncio_mode = "auto"
72
+ asyncio_default_fixture_loop_scope = "session"
73
+
74
+ [tool.pyright]
75
+ include = [
76
+ "src",
77
+ "tests",
78
+ ]
79
+ pythonVersion = "3.10"
80
+ typeCheckingMode = "standard"
81
+
82
+ [tool.ruff]
83
+ line-length = 88
84
+ src = [
85
+ "src",
86
+ "tests",
87
+ ]
88
+ target-version = "py310"
89
+
90
+ [tool.ruff.lint]
91
+ select = [
92
+ "E",
93
+ "F",
94
+ "I",
95
+ "UP",
96
+ "ASYNC",
97
+ "C4",
98
+ "PT",
99
+ "RUF",
100
+ ]
101
+ ignore = [
102
+ "E402",
103
+ "UP037",
104
+ "RUF001",
105
+ "RUF002",
106
+ "RUF003",
107
+ ]
@@ -0,0 +1,76 @@
1
+ [project]
2
+ name = "nonebot-plugin-ifollow"
3
+ version = "1.0.0"
4
+ description = "NoneBot2 多平台作者更新订阅插件"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ authors = [{ name = "ByteColtX", email = "umk@live.com" }]
8
+ dependencies = [
9
+ "httpx>=0.27.0,<1.0.0",
10
+ "nonebot-adapter-onebot>=2.4.6,<3.0.0",
11
+ "nonebot-plugin-alconna>=0.60.0,<1.0.0",
12
+ "nonebot-plugin-apscheduler>=0.5.0,<1.0.0",
13
+ "nonebot-plugin-localstore>=0.7.4,<1.0.0",
14
+ "nonebot-plugin-parser>=2.6.8,<3.0.0",
15
+ "nonebot2>=2.5.0,<3.0.0",
16
+ ]
17
+
18
+ [project.urls]
19
+ Homepage = "https://github.com/ByteColtX/nonebot-plugin-ifollow"
20
+ Issues = "https://github.com/ByteColtX/nonebot-plugin-ifollow/issues"
21
+ Repository = "https://github.com/ByteColtX/nonebot-plugin-ifollow.git"
22
+
23
+ [dependency-groups]
24
+ dev = [
25
+ "basedpyright>=1.31.0,<2.0.0",
26
+ "bump-my-version>=1.2.7",
27
+ "nonebot2[fastapi]>=2.5.0,<3.0.0",
28
+ "poethepoet>=0.42.1",
29
+ "pytest>=9.0.2,<10.0.0",
30
+ "pytest-asyncio>=1.3.0,<1.4.0",
31
+ "pytest-cov>=7.0.0",
32
+ "pytest-xdist>=3.8.0,<4.0.0",
33
+ "ruff>=0.15.2,<1.0.0",
34
+ ]
35
+
36
+ [build-system]
37
+ requires = ["uv_build>=0.10.0,<0.13.0"]
38
+ build-backend = "uv_build"
39
+
40
+ [tool.nonebot]
41
+ plugins = ["nonebot_plugin_ifollow"]
42
+
43
+ [tool.poe.tasks]
44
+ test = "pytest --cov=src --cov-report=xml --junitxml=./junit.xml -n auto"
45
+ bump = "bump-my-version bump"
46
+ show-bump = "bump-my-version show-bump"
47
+
48
+ [tool.bumpversion]
49
+ current_version = "0.1.0"
50
+ commit = true
51
+ message = "release: 将版本从 {current_version} 更新至 {new_version}"
52
+ tag = true
53
+
54
+ [[tool.bumpversion.files]]
55
+ filename = "uv.lock"
56
+ search = "name = \"nonebot-plugin-ifollow\"\nversion = \"{current_version}\""
57
+ replace = "name = \"nonebot-plugin-ifollow\"\nversion = \"{new_version}\""
58
+
59
+ [tool.pytest]
60
+ pythonpath = ["src", "tests"]
61
+ asyncio_mode = "auto"
62
+ asyncio_default_fixture_loop_scope = "session"
63
+
64
+ [tool.pyright]
65
+ include = ["src", "tests"]
66
+ pythonVersion = "3.10"
67
+ typeCheckingMode = "standard"
68
+
69
+ [tool.ruff]
70
+ line-length = 88
71
+ src = ["src", "tests"]
72
+ target-version = "py310"
73
+
74
+ [tool.ruff.lint]
75
+ select = ["E", "F", "I", "UP", "ASYNC", "C4", "PT", "RUF"]
76
+ ignore = ["E402", "UP037", "RUF001", "RUF002", "RUF003"]
@@ -0,0 +1,27 @@
1
+ """爱播作者更新订阅插件。"""
2
+
3
+ from nonebot import require
4
+ from nonebot.plugin import PluginMetadata
5
+
6
+ require("nonebot_plugin_parser")
7
+ require("nonebot_plugin_apscheduler")
8
+
9
+ from .config import Config
10
+
11
+ __plugin_meta__ = PluginMetadata(
12
+ name="爱播作者订阅",
13
+ description="订阅抖音和 B 站作者的新作品及动态并发送",
14
+ usage=(
15
+ "爱播帮助\n爱播订阅 <作者主页或作品链接>\n爱播订阅列表\n"
16
+ "爱播取消订阅 <序号或作者主页或作品链接>"
17
+ ),
18
+ type="application",
19
+ homepage="https://github.com/ByteColtX/nonebot-plugin-ifollow",
20
+ config=Config,
21
+ supported_adapters={"~onebot.v11"},
22
+ extra={"author": "ByteColtX <umk@live.com>"},
23
+ )
24
+
25
+ from . import plugin as plugin
26
+
27
+ __all__ = ["plugin"]
@@ -0,0 +1,20 @@
1
+ """爱播使用的 B 站 parser 适配。"""
2
+
3
+ from __future__ import annotations
4
+
5
+ from bilibili_api import Credential
6
+ from nonebot_plugin_parser.parsers.bilibili import BilibiliParser
7
+
8
+ from .bilibili_platform import _parse_cookie
9
+ from .config import config
10
+
11
+
12
+ class IFollowBilibiliParser(BilibiliParser):
13
+ """为 B 站 parser 注入爱播的可选 Cookie。"""
14
+
15
+ def __init__(self) -> None:
16
+ super().__init__()
17
+ if config.ifollow_bilibili_cookie:
18
+ self._credential = Credential.from_cookies(
19
+ _parse_cookie(config.ifollow_bilibili_cookie)
20
+ )