nonebot-plugin-parser 2.6.2__py3-none-any.whl → 2.6.4__py3-none-any.whl

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.
@@ -22,6 +22,10 @@ class MediaElement(Struct):
22
22
  def duration(self) -> float | None:
23
23
  return self.duration_millis / 1000 if self.duration_millis else None
24
24
 
25
+ @property
26
+ def original_url(self) -> str:
27
+ return self.url + ":orig"
28
+
25
29
 
26
30
  class Article(Struct):
27
31
  image: str | None = None
@@ -90,9 +94,10 @@ class TwitterParser(BaseParser):
90
94
  )
91
95
  result.contents.append(video)
92
96
  elif media.type == "image":
93
- result.contents.append(self.create_image(media.url))
97
+ result.contents.append(self.create_image(media.original_url))
94
98
 
95
- result.repost = self._collect_result(data.qrt) if data.qrt else None
99
+ if data.qrt:
100
+ result.repost = self._collect_result(data.qrt)
96
101
 
97
102
  return result
98
103
 
@@ -577,10 +577,12 @@
577
577
  {% if result.title and result.video %}<div class="title">{{ result.title }}</div>{% endif %}
578
578
  {# ── Text(非动态类型) ── #}
579
579
  {% if content_type != '动态' and result.text %}<div class="text">{{ result.text }}</div>{% endif %}
580
-
581
- {# ── Image Grid ── #}
580
+
582
581
  {% set imgs = result.all_grid_images %}
583
- {% if imgs %}
582
+ {% if video%}
583
+ {# 如果有视频,则不显示图片网格 #}
584
+ {# ── Image Grid ── #}
585
+ {% elif imgs %}
584
586
  {% set count = imgs|length %}
585
587
  {% if count == 1 %}
586
588
  {% set img = imgs[0] %}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: nonebot-plugin-parser
3
- Version: 2.6.2
3
+ Version: 2.6.4
4
4
  Summary: NoneBot2 链接分享解析 Alconna 版, 现支持B站|抖音|快手|微博|小红书|YouTube|TikTok|Twitter|AcFun|NGA
5
5
  Keywords: acfun,bilibili,douyin,kuaishou,nga,nonebot,nonebot2,tiktok,twitter,video,weibo,xiaohongshu,youtube
6
6
  Author: fllesser
@@ -31,7 +31,7 @@ nonebot_plugin_parser/parsers/kuaishou/states.py,sha256=Smri21qn_FeoEB0I4kZ9CJrR
31
31
  nonebot_plugin_parser/parsers/nga.py,sha256=Z1F5CaiZIvdZu7YIprj2zQubZxzuLHpXOpndtWPvT3k,6170
32
32
  nonebot_plugin_parser/parsers/task.py,sha256=0pTFlpGYVdsgTqgp4f9GGpfRHidxSR4P98LCMi7yAQo,1290
33
33
  nonebot_plugin_parser/parsers/tiktok.py,sha256=GMVhYSHpU2AqqY95t1YxOkBqEKzsaaxa3rX9VdYiLIY,1169
34
- nonebot_plugin_parser/parsers/twitter.py,sha256=JhT3ODh5XobtKl72uXwRq-s2XLqIWgc8rgGMXXOfp58,5545
34
+ nonebot_plugin_parser/parsers/twitter.py,sha256=FkZrrarDy8DPeYMSB4-crsfDcu-qYDV_-nansiaweGQ,5641
35
35
  nonebot_plugin_parser/parsers/utils.py,sha256=rSKkqLHxJtlupTChzxVjMGRLvAqruB3KKno5qGjeST8,360
36
36
  nonebot_plugin_parser/parsers/weibo/__init__.py,sha256=C_gdSfyZSejcbhODsDQGmYXvj05S1qfJEHTdvZStTy0,9552
37
37
  nonebot_plugin_parser/parsers/weibo/article.py,sha256=ssHxkB8cjMozkQxV6hh6_-Rrb5aLfJHjokY680HGBo0,342
@@ -69,8 +69,8 @@ nonebot_plugin_parser/renders/resources/twitter.png,sha256=Pn3E3NYjaFgx7fkKOj23P
69
69
  nonebot_plugin_parser/renders/resources/weibo.png,sha256=fTEbbC7N3k89DrHmROXYWdwYujaEGaThnie9pwoDetA,2425
70
70
  nonebot_plugin_parser/renders/resources/xiaohongshu.png,sha256=Q7-e1DUZmhun3iKUlPKfh-zpeF1mm6_PyAjjh1OrL_A,2732
71
71
  nonebot_plugin_parser/renders/resources/youtube.png,sha256=dTecHnCRLgJGxuEZPQ4vIefQEjNKTsTDmdvKCCa6lmk,3179
72
- nonebot_plugin_parser/renders/templates/card.html.jinja2,sha256=bj8-_5HvkKMmfxzGHZidj-IVJZLc_yUp0PDi-E4M8DI,24699
72
+ nonebot_plugin_parser/renders/templates/card.html.jinja2,sha256=yThUTJr-235kdNZ9azWPSzaii2FzvxzFABMm2N_IYCs,24836
73
73
  nonebot_plugin_parser/utils.py,sha256=bw_KJUrLmd1_O-Q3n9xjZBNoTat6Yrf62JzBwciS9DY,5800
74
- nonebot_plugin_parser-2.6.2.dist-info/WHEEL,sha256=bEhYrD-rjlF0iRRHiAnfJ0mEjMsRwm29hhDD7yRgWCY,80
75
- nonebot_plugin_parser-2.6.2.dist-info/METADATA,sha256=HnntM0dgfvAnO1qYXGpqshiOY7IRTBTteJUDlzsIb20,17875
76
- nonebot_plugin_parser-2.6.2.dist-info/RECORD,,
74
+ nonebot_plugin_parser-2.6.4.dist-info/WHEEL,sha256=q5IF0q2xCp3ktUFRCVWsQLjl2ChNlWXBJtnI1LCGdJ8,80
75
+ nonebot_plugin_parser-2.6.4.dist-info/METADATA,sha256=QzAT1bECI5qzZqHzH5cRxzx_dScyOkUaiR_vpkUwj-k,17875
76
+ nonebot_plugin_parser-2.6.4.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.11.3
2
+ Generator: uv 0.11.8
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any