nonebot-plugin-parser 2.0.13__tar.gz → 2.0.14__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_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/PKG-INFO +4 -4
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/pyproject.toml +11 -11
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/__init__.py +1 -1
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/data.py +1 -1
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/nga.py +6 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/default.py +9 -7
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/README.md +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/config.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/constants.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/download/__init__.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/download/task.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/download/ytdlp.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/exception.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/helper.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/matchers/__init__.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/matchers/filter.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/matchers/preprocess.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/__init__.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/acfun.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/base.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/bilibili/__init__.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/bilibili/article.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/bilibili/common.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/bilibili/dynamic.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/bilibili/favlist.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/bilibili/live.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/bilibili/opus.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/bilibili/video.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/cookie.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/douyin/__init__.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/douyin/slides.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/douyin/video.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/kuaishou.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/tiktok.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/twitter.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/weibo.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/xiaohongshu.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/parsers/youtube.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/__init__.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/base.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/common.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/resources/HYSongYunLangHeiW-1.ttf +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/resources/bilibili.png +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/resources/douyin.png +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/resources/kuaishou.png +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/resources/media_button.png +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/resources/tiktok.png +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/resources/twitter.png +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/resources/weibo.png +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/resources/xiaohongshu.png +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/resources/youtube.png +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/templates/weibo.html.jinja +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/renders/weibo.py +0 -0
- {nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: nonebot-plugin-parser
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.14
|
|
4
4
|
Summary: NoneBot2 链接分享解析 Alconna 版, 通用媒体卡片渲染(PIL 实现), 支持 B站/抖音/快手/微博/小红书/youtube/tiktok/twitter/acfun/nga
|
|
5
5
|
Keywords: nonebot,nonebot2,video,bilibili,youtube,tiktok,twitter,kuaishou,acfun,weibo,xiaohongshu,nga,douyin
|
|
6
6
|
Author: fllesser
|
|
@@ -8,12 +8,12 @@ Author-email: fllesser <fllessive@gmail.com>
|
|
|
8
8
|
Requires-Dist: msgspec>=0.19.0,<1.0.0
|
|
9
9
|
Requires-Dist: httpx>=0.27.2,<1.0.0
|
|
10
10
|
Requires-Dist: tqdm>=4.67.1,<5.0.0
|
|
11
|
-
Requires-Dist: aiofiles>=
|
|
11
|
+
Requires-Dist: aiofiles>=25.1.0
|
|
12
12
|
Requires-Dist: pillow>=11.0.0
|
|
13
13
|
Requires-Dist: curl-cffi>=0.13.0,<1.0.0
|
|
14
|
-
Requires-Dist: bilibili-api-python>=17.
|
|
14
|
+
Requires-Dist: bilibili-api-python>=17.4.0,<18.0.0
|
|
15
15
|
Requires-Dist: beautifulsoup4>=4.12.0,<5.0.0
|
|
16
|
-
Requires-Dist: yt-dlp>=2025.
|
|
16
|
+
Requires-Dist: yt-dlp>=2025.10.14
|
|
17
17
|
Requires-Dist: nonebot2>=2.4.3,<3.0.0
|
|
18
18
|
Requires-Dist: nonebot-plugin-localstore>=0.7.4,<1.0.0
|
|
19
19
|
Requires-Dist: nonebot-plugin-apscheduler>=0.5.0,<1.0.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "nonebot-plugin-parser"
|
|
3
|
-
version = "2.0.
|
|
3
|
+
version = "2.0.14"
|
|
4
4
|
description = "NoneBot2 链接分享解析 Alconna 版, 通用媒体卡片渲染(PIL 实现), 支持 B站/抖音/快手/微博/小红书/youtube/tiktok/twitter/acfun/nga"
|
|
5
5
|
authors = [{ "name" = "fllesser", "email" = "fllessive@gmail.com" }]
|
|
6
6
|
readme = "README.md"
|
|
@@ -24,14 +24,14 @@ dependencies = [
|
|
|
24
24
|
"msgspec>=0.19.0,<1.0.0",
|
|
25
25
|
"httpx>=0.27.2,<1.0.0",
|
|
26
26
|
"tqdm>=4.67.1,<5.0.0",
|
|
27
|
-
"aiofiles>=
|
|
27
|
+
"aiofiles>=25.1.0",
|
|
28
28
|
"pillow>=11.0.0",
|
|
29
29
|
|
|
30
30
|
# 后续改为可选依赖
|
|
31
31
|
"curl_cffi>=0.13.0,<1.0.0",
|
|
32
|
-
"bilibili-api-python>=17.
|
|
32
|
+
"bilibili-api-python>=17.4.0,<18.0.0",
|
|
33
33
|
"beautifulsoup4>=4.12.0,<5.0.0",
|
|
34
|
-
"yt-dlp>=2025.
|
|
34
|
+
"yt-dlp>=2025.10.14",
|
|
35
35
|
|
|
36
36
|
"nonebot2>=2.4.3,<3.0.0",
|
|
37
37
|
"nonebot-plugin-localstore>=0.7.4,<1.0.0",
|
|
@@ -68,18 +68,18 @@ test = [
|
|
|
68
68
|
]
|
|
69
69
|
|
|
70
70
|
telegram = ["nonebot-adapter-telegram>=0.1.0b20"]
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
pydantic-v1 = ["pydantic<2.0.0"] # renovate:ignore
|
|
72
|
+
pydantic-v2 = ["pydantic>=2.0.0"]
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
extras = ["nonebot-plugin-htmlkit>=0.1.0rc3"]
|
|
75
75
|
|
|
76
76
|
[tool.uv]
|
|
77
77
|
required-version = ">=0.9.2"
|
|
78
|
-
default-groups = ["test", "dev", "
|
|
78
|
+
default-groups = ["test", "dev", "extras"]
|
|
79
79
|
conflicts = [
|
|
80
80
|
[
|
|
81
|
-
{ group = "
|
|
82
|
-
{ group = "
|
|
81
|
+
{ group = "pydantic-v1" },
|
|
82
|
+
{ group = "pydantic-v2" },
|
|
83
83
|
{ group = "telegram" },
|
|
84
84
|
],
|
|
85
85
|
]
|
|
@@ -195,7 +195,7 @@ build-backend = "uv_build"
|
|
|
195
195
|
|
|
196
196
|
|
|
197
197
|
[tool.bumpversion]
|
|
198
|
-
current_version = "2.0.
|
|
198
|
+
current_version = "2.0.14"
|
|
199
199
|
commit = true
|
|
200
200
|
message = "🔖 release: bump vesion from {current_version} to {new_version}"
|
|
201
201
|
tag = true
|
{nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/__init__.py
RENAMED
|
@@ -12,7 +12,7 @@ from .utils import safe_unlink
|
|
|
12
12
|
|
|
13
13
|
__plugin_meta__ = PluginMetadata(
|
|
14
14
|
name="链接分享解析 Alconna 版",
|
|
15
|
-
description="
|
|
15
|
+
description="通用媒体卡片渲染(PIL 实现)[B站|抖音|快手|微博|小红书|YouTube|TikTok|Twitter|AcFun|NGA]",
|
|
16
16
|
usage="发送支持平台的(BV号/链接/小程序/卡片)即可",
|
|
17
17
|
type="application",
|
|
18
18
|
homepage="https://github.com/fllesser/nonebot-plugin-parser",
|
|
@@ -38,6 +38,7 @@ class NGAParser(BaseParser):
|
|
|
38
38
|
"Upgrade-Insecure-Requests": "1",
|
|
39
39
|
}
|
|
40
40
|
self.headers.update(extra_headers)
|
|
41
|
+
self.base_img_url = "https://img.nga.178.com/attachments"
|
|
41
42
|
|
|
42
43
|
@staticmethod
|
|
43
44
|
def nga_url(tid: str | int) -> str:
|
|
@@ -140,9 +141,13 @@ class NGAParser(BaseParser):
|
|
|
140
141
|
# 提取文本 - postcontent0
|
|
141
142
|
text = None
|
|
142
143
|
content_tag = soup.find(id="postcontent0")
|
|
144
|
+
contents = []
|
|
143
145
|
if content_tag and isinstance(content_tag, Tag):
|
|
144
146
|
text = content_tag.get_text("\n", strip=True)
|
|
145
147
|
# 清理 BBCode 标签并限制长度
|
|
148
|
+
img_urls: list[str] = re.findall(r"\[img\](.*?)\[/img\]", text)
|
|
149
|
+
img_urls = [self.base_img_url + url[1:] for url in img_urls]
|
|
150
|
+
contents.extend(self.create_image_contents(img_urls))
|
|
146
151
|
text = self.clean_nga_text(text)
|
|
147
152
|
|
|
148
153
|
return self.result(
|
|
@@ -150,6 +155,7 @@ class NGAParser(BaseParser):
|
|
|
150
155
|
text=text,
|
|
151
156
|
url=url,
|
|
152
157
|
author=author,
|
|
158
|
+
contents=contents,
|
|
153
159
|
timestamp=timestamp,
|
|
154
160
|
)
|
|
155
161
|
|
|
@@ -20,20 +20,22 @@ class DefaultRenderer(BaseRenderer):
|
|
|
20
20
|
Generator[UniMessage[Any], None, None]: 消息生成器
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
|
-
texts =
|
|
23
|
+
texts = [
|
|
24
24
|
result.header,
|
|
25
25
|
result.text,
|
|
26
26
|
result.extra_info,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
if self.append_url:
|
|
30
|
+
texts.extend((result.display_url, result.repost_display_url))
|
|
31
|
+
|
|
30
32
|
texts = [text for text in texts if text]
|
|
31
33
|
texts[:-1] = [text + "\n" for text in texts[:-1]]
|
|
32
|
-
|
|
33
34
|
segs: list[Segment] = [Text(text) for text in texts]
|
|
34
|
-
|
|
35
|
-
if cover_path
|
|
35
|
+
|
|
36
|
+
if cover_path := await result.cover_path:
|
|
36
37
|
segs.insert(1, UniHelper.img_seg(cover_path))
|
|
38
|
+
|
|
37
39
|
yield UniMessage(segs)
|
|
38
40
|
|
|
39
41
|
async for message in self.render_contents(result):
|
|
File without changes
|
{nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/config.py
RENAMED
|
File without changes
|
{nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/constants.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/exception.py
RENAMED
|
File without changes
|
{nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/helper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nonebot_plugin_parser-2.0.13 → nonebot_plugin_parser-2.0.14}/src/nonebot_plugin_parser/utils.py
RENAMED
|
File without changes
|