sticker-convert 2.13.2.0__py3-none-any.whl → 2.13.2.2__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.
@@ -597,12 +597,12 @@ class StickerConvert:
597
597
  else:
598
598
  frame_resized = frame
599
599
 
600
- # yuva420p may cause crash for pyav < 14
600
+ # yuva420p may cause crash
601
601
  # Not safe to directly call frame.to_ndarray(format="rgba")
602
602
  # https://github.com/PyAV-Org/PyAV/discussions/1510
603
- if int(av.__version__.split(".")[0]) >= 14:
604
- rgba_array = frame_resized.to_ndarray(format="rgba")
605
- elif frame_resized.format.name == "yuv420p":
603
+ # if int(av.__version__.split(".")[0]) >= 14:
604
+ # rgba_array = frame_resized.to_ndarray(format="rgba")
605
+ if frame_resized.format.name == "yuv420p":
606
606
  rgb_array = frame_resized.to_ndarray(format="rgb24")
607
607
  rgba_array = np.dstack(
608
608
  (
@@ -252,7 +252,7 @@ class DownloadLine(DownloadBase):
252
252
  )
253
253
 
254
254
  for num, sticker in enumerate(self.pack_files):
255
- if self.resource_type == "ANIMATION":
255
+ if self.has_animation is True:
256
256
  f_path = str(sticker) + "_animation.png"
257
257
  else:
258
258
  f_path = str(sticker) + ".png"
@@ -273,13 +273,13 @@ class DownloadLine(DownloadBase):
273
273
  )
274
274
 
275
275
  for num, sticker in enumerate(self.pack_files):
276
- if self.resource_type in ("ANIMATION", "ANIMATION_SOUND"):
277
- f_path = "animation@2x/" + str(sticker["id"]) + "@2x.png"
278
- elif self.resource_type == "POPUP":
276
+ if self.resource_type == "POPUP":
279
277
  if sticker.get("popup", {}).get("layer") == "BACKGROUND":
280
278
  f_path = str(sticker["id"]) + "@2x.png"
281
279
  self.decompress(zf, f_path, num, "preview-")
282
280
  f_path = "popup/" + str(sticker["id"]) + ".png"
281
+ elif self.has_animation is True:
282
+ f_path = "animation@2x/" + str(sticker["id"]) + "@2x.png"
283
283
  else:
284
284
  f_path = str(sticker["id"]) + "@2x.png"
285
285
  self.decompress(zf, f_path, num)
@@ -165,22 +165,32 @@ class UploadTelegram(UploadBase):
165
165
  src, fmt=spec_choice.get_format(), file_info=file_info
166
166
  )
167
167
  )
168
- if sticker_format == "video":
169
- # For video stickers (Only)
170
- # Allow file with one of the dimension = 512 but another <512
171
- # https://core.telegram.org/stickers#video-requirements
172
- check_file_result = check_file_result and (
173
- file_info.res[0] == 512 or file_info.res[1] == 512
174
- )
175
- check_file_result = check_file_result and (
176
- file_info.res[0] <= 512 and file_info.res[1] <= 512
177
- )
168
+ if self.opt_output.option == "telegram":
169
+ if sticker_format == "animated":
170
+ check_file_result = (
171
+ check_file_result
172
+ and file_info.res[0] == 512
173
+ and file_info.res[1] == 512
174
+ )
175
+ else:
176
+ # For video and static stickers (Not animated)
177
+ # Allow file with one of the dimension = 512 but another <512
178
+ # https://core.telegram.org/stickers#video-requirements
179
+ check_file_result = check_file_result and (
180
+ file_info.res[0] == 512 or file_info.res[1] == 512
181
+ )
182
+ check_file_result = check_file_result and (
183
+ file_info.res[0] <= 512 and file_info.res[1] <= 512
184
+ )
178
185
  else:
186
+ # telegram_emoji
179
187
  check_file_result = (
180
188
  check_file_result
181
- and file_info.res[0] == 512
182
- and file_info.res[1] == 512
189
+ and file_info.res[0] == 100
190
+ and file_info.res[1] == 100
183
191
  )
192
+
193
+ if sticker_format == "static":
184
194
  # It is important to check if webp and png are static only
185
195
  check_file_result = check_file_result and FormatVerify.check_animated(
186
196
  src, animated=spec_choice.animated, file_info=file_info
@@ -298,7 +308,6 @@ class UploadTelegram(UploadBase):
298
308
  stickers_total = 0
299
309
  stickers_ok = 0
300
310
  for pack_title, stickers in packs.items():
301
- stickers_total += len(stickers)
302
311
  self.cb.put(f"Uploading pack {pack_title}")
303
312
  result, stickers_total_pack, stickers_ok_pack = anyio.run(
304
313
  self.upload_pack, pack_title, stickers, emoji_dict
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env python3
2
2
 
3
- __version__ = "2.13.2.0"
3
+ __version__ = "2.13.2.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sticker-convert
3
- Version: 2.13.2.0
3
+ Version: 2.13.2.2
4
4
  Summary: Convert (animated) stickers to/from WhatsApp, Telegram, Signal, Line, Kakao, Viber, Discord, iMessage. Written in Python.
5
5
  Author-email: laggykiller <chaudominic2@gmail.com>
6
6
  Maintainer-email: laggykiller <chaudominic2@gmail.com>
@@ -1,18 +1,18 @@
1
1
  sticker_convert/__init__.py,sha256=iQnv6UOOA69c3soAn7ZOnAIubTIQSUxtq1Uhh8xRWvU,102
2
2
  sticker_convert/__main__.py,sha256=elDCMvU27letiYs8jPUpxaCq5puURnvcDuqGsAAb6_w,592
3
3
  sticker_convert/cli.py,sha256=RG62v3JFSokhKZo1J7zbc1NL0oY43ufVrIub8nT_f_A,22582
4
- sticker_convert/converter.py,sha256=6_FGXW-S6t2xs56fid49z2FaEc1VFtJ-jJOA-SUKSH8,39760
4
+ sticker_convert/converter.py,sha256=BQQJ7pARKkq_Jeerp3n8aUuVcgTkfqh9BdIWTGQzigM,39748
5
5
  sticker_convert/definitions.py,sha256=BqROmOvqIqw8ANaqZXIxJAXGD0HgjAvCfFouQ4SaWHc,2254
6
6
  sticker_convert/gui.py,sha256=bd8rMgFaXrn41y6aOHNlD6gPBDleDmiHMsGMZNfz1jk,34239
7
7
  sticker_convert/job.py,sha256=jK65lOuPyevQ6Pt9Qw029bGcgYLMuaHlexpc1n1qFxE,28416
8
8
  sticker_convert/job_option.py,sha256=yI_uKWJEAul2XTC6pucz9PfW0iNwwOr0aVC-PAHkMA4,8109
9
- sticker_convert/version.py,sha256=JBpDy60QO4QozrGe48BrcEqhaz4JxxfNhqnSeo_ed3Y,49
9
+ sticker_convert/version.py,sha256=ShiNfvTMXtQL5MGpW_XtFvnqGR0JVLREGxj2lS8M6q0,49
10
10
  sticker_convert/downloaders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  sticker_convert/downloaders/download_band.py,sha256=JPjwwdxbMXPBM9TXF76wT9mtoDCLssYnrm1iS2C6uVM,3629
12
12
  sticker_convert/downloaders/download_base.py,sha256=MI5pCT_tkfoaFlrD1oNynDj1Rv1CK0APuNVElTEAEis,5110
13
13
  sticker_convert/downloaders/download_discord.py,sha256=6AFpLAYL2hRvVcsqUtzDUC31U66U02ZcnKXDnZRi2jk,3496
14
14
  sticker_convert/downloaders/download_kakao.py,sha256=lRmpEcYjHizIRM0uFBDvjMqNEpur0VmOTKAmiir9eB0,15181
15
- sticker_convert/downloaders/download_line.py,sha256=751-g6BH0ITwNlYNsZuBxyB92Q8f3o6Qv9VHmHDoLps,18161
15
+ sticker_convert/downloaders/download_line.py,sha256=yISEgSpFtQtLUdWH5b8Qby9l3qY5U6o34DgTt9aqmIw,18126
16
16
  sticker_convert/downloaders/download_ogq.py,sha256=-iSTQaCUlROfY7a9EFhJGq6fenY48AZEevfQLT9-pAk,2951
17
17
  sticker_convert/downloaders/download_signal.py,sha256=3wv-BLd4qggly4AdtwV8f3vUpCVZ-8GnoPLoWngY3Pk,3728
18
18
  sticker_convert/downloaders/download_telegram.py,sha256=iGmOcVjU2Ai19t1lyDY2JhQIc--O5XMyNCGXZAA4DVY,2028
@@ -83,7 +83,7 @@ sticker_convert/uploaders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
83
83
  sticker_convert/uploaders/compress_wastickers.py,sha256=Rgl3WzIDJn7oa00nNqeBFDqIHP-cWvgQqET2-kDbf9c,7417
84
84
  sticker_convert/uploaders/upload_base.py,sha256=uQupPn6r4zrlAzpKzzX7CgvZb69ATyrwPKahWOQj0ds,1203
85
85
  sticker_convert/uploaders/upload_signal.py,sha256=k9XS6oU0gYCXEph-LzWvUP3IDINAVaQzzzNgDRp_YNM,7443
86
- sticker_convert/uploaders/upload_telegram.py,sha256=WlUyLJlW83XZz6RhA76jHMXA6TNUIEVbPwhi14RTnds,12482
86
+ sticker_convert/uploaders/upload_telegram.py,sha256=CAZI0cOXImFjKL6MIeIfY2Xfhil8sqntQBxOrnROooo,12862
87
87
  sticker_convert/uploaders/upload_viber.py,sha256=_vOK0UgP7V7ZeFG6pR3sVf3A744Q6J19qzO-2hDvt5w,6583
88
88
  sticker_convert/uploaders/xcode_imessage.py,sha256=iTTT8gDYOTNkKqXeSWUBuWfxu7xeE418t2Z1YQFR5L0,11365
89
89
  sticker_convert/utils/callback.py,sha256=spYUGlklOs1yPZAxoqwOWgR1sdimpfM8a27if3TaVYk,6155
@@ -113,9 +113,9 @@ sticker_convert/utils/media/apple_png_normalize.py,sha256=LbrQhc7LlYX4I9ek4XJsZE
113
113
  sticker_convert/utils/media/codec_info.py,sha256=HwA6eVh7cLhOlUoR_K9d_wyBRJ_ocGtB3GAyne_iZAU,16483
114
114
  sticker_convert/utils/media/decrypt_kakao.py,sha256=4wq9ZDRnFkx1WmFZnyEogBofiLGsWQM_X69HlA36578,1947
115
115
  sticker_convert/utils/media/format_verify.py,sha256=oM32P186tWe9YxvBQRPr8D3FEmBN3b2rEe_2S_MwxyQ,6236
116
- sticker_convert-2.13.2.0.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
117
- sticker_convert-2.13.2.0.dist-info/METADATA,sha256=oMckf3XjtI1hDvWtREahWjzkEWpbFmK9_S4ODLCjHmI,55170
118
- sticker_convert-2.13.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
119
- sticker_convert-2.13.2.0.dist-info/entry_points.txt,sha256=MNJ7XyC--ugxi5jS1nzjDLGnxCyLuaGdsVLnJhDHCqs,66
120
- sticker_convert-2.13.2.0.dist-info/top_level.txt,sha256=r9vfnB0l1ZnH5pTH5RvkobnK3Ow9m0RsncaOMAtiAtk,16
121
- sticker_convert-2.13.2.0.dist-info/RECORD,,
116
+ sticker_convert-2.13.2.2.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
117
+ sticker_convert-2.13.2.2.dist-info/METADATA,sha256=SfPCujs8Oth6H4InFL4nbMOWBIUw6orJDMzKXRSSDaI,55170
118
+ sticker_convert-2.13.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
119
+ sticker_convert-2.13.2.2.dist-info/entry_points.txt,sha256=MNJ7XyC--ugxi5jS1nzjDLGnxCyLuaGdsVLnJhDHCqs,66
120
+ sticker_convert-2.13.2.2.dist-info/top_level.txt,sha256=r9vfnB0l1ZnH5pTH5RvkobnK3Ow9m0RsncaOMAtiAtk,16
121
+ sticker_convert-2.13.2.2.dist-info/RECORD,,