sticker-convert 2.1.7__py3-none-any.whl → 2.1.9__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.
- sticker_convert/__init__.py +1 -1
- sticker_convert/utils/auth/get_signal_auth.py +17 -8
- sticker_convert/utils/files/metadata_handler.py +2 -2
- sticker_convert/utils/media/codec_info.py +29 -14
- {sticker_convert-2.1.7.dist-info → sticker_convert-2.1.9.dist-info}/METADATA +2 -2
- {sticker_convert-2.1.7.dist-info → sticker_convert-2.1.9.dist-info}/RECORD +10 -10
- {sticker_convert-2.1.7.dist-info → sticker_convert-2.1.9.dist-info}/LICENSE +0 -0
- {sticker_convert-2.1.7.dist-info → sticker_convert-2.1.9.dist-info}/WHEEL +0 -0
- {sticker_convert-2.1.7.dist-info → sticker_convert-2.1.9.dist-info}/entry_points.txt +0 -0
- {sticker_convert-2.1.7.dist-info → sticker_convert-2.1.9.dist-info}/top_level.txt +0 -0
sticker_convert/__init__.py
CHANGED
@@ -129,15 +129,21 @@ class GetSignalAuth:
|
|
129
129
|
chromedriver_url = f'https://chromedriver.storage.googleapis.com/{chromedriver_version}/chromedriver_{chromedriver_platform}.zip'
|
130
130
|
else:
|
131
131
|
new_chrome = True
|
132
|
-
r = requests.get('https://googlechromelabs.github.io/chrome-for-testing/
|
132
|
+
r = requests.get('https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone-with-downloads.json')
|
133
133
|
versions_dict = json.loads(r.text)
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
134
|
+
chromedriver_list = versions_dict \
|
135
|
+
.get('milestones', {}) \
|
136
|
+
.get(major_version, {}) \
|
137
|
+
.get('downloads', {}) \
|
138
|
+
.get('chromedriver', {})
|
139
|
+
|
140
|
+
chromedriver_url = None
|
141
|
+
for i in chromedriver_list:
|
142
|
+
if i.get('platform') == chromedriver_platform_new:
|
143
|
+
chromedriver_url = i.get('url')
|
144
|
+
|
145
|
+
if not chromedriver_url:
|
146
|
+
return ''
|
141
147
|
|
142
148
|
if platform.system() == 'Windows':
|
143
149
|
chromedriver_name = 'chromedriver.exe'
|
@@ -251,6 +257,9 @@ class GetSignalAuth:
|
|
251
257
|
self.cb_msg(f'Found chromedriver version {local_chromedriver_version}, skip downloading')
|
252
258
|
else:
|
253
259
|
chromedriver_path = self.download_chromedriver(major_version, chromedriver_download_dir=self.chromedriver_download_dir)
|
260
|
+
if chromedriver_path == '':
|
261
|
+
self.cb_msg('Unable to download suitable chromedriver')
|
262
|
+
return
|
254
263
|
|
255
264
|
self.cb_msg('Killing all Signal Desktop processes')
|
256
265
|
self.killall_signal()
|
@@ -184,7 +184,7 @@ class MetadataHandler:
|
|
184
184
|
anim_present = anim_present or len(anim_stickers) > 0
|
185
185
|
image_present = image_present or len(image_stickers) > 0
|
186
186
|
|
187
|
-
finished_all = True if processed == len(stickers_present) else False
|
187
|
+
finished_all = True if processed == len(stickers_present) - 1 else False
|
188
188
|
|
189
189
|
if len(anim_stickers) == file_per_anim_pack or (
|
190
190
|
finished_all and len(anim_stickers) > 0
|
@@ -212,7 +212,7 @@ class MetadataHandler:
|
|
212
212
|
|
213
213
|
stickers.append(file_path)
|
214
214
|
|
215
|
-
finished_all = True if processed == len(stickers_present) else False
|
215
|
+
finished_all = True if processed == len(stickers_present) - 1 else False
|
216
216
|
|
217
217
|
if len(stickers) == file_per_pack or (
|
218
218
|
finished_all and len(stickers) > 0
|
@@ -30,22 +30,37 @@ class CodecInfo:
|
|
30
30
|
fps = anim.lottie_animation_get_framerate()
|
31
31
|
else:
|
32
32
|
if file_ext == ".webp":
|
33
|
+
total_duration = 0
|
34
|
+
frames = 0
|
35
|
+
|
33
36
|
with open(file, "r+b") as f:
|
34
37
|
mm = mmap.mmap(f.fileno(), 0)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
38
|
+
while True:
|
39
|
+
anmf_pos = mm.find(b"ANMF")
|
40
|
+
if anmf_pos == -1:
|
41
|
+
break
|
42
|
+
mm.seek(anmf_pos + 20)
|
43
|
+
frame_duration_32 = mm.read(4)
|
44
|
+
frame_duration = frame_duration_32[:-1] + bytes(
|
45
|
+
int(frame_duration_32[-1]) & 0b11111100
|
46
|
+
)
|
47
|
+
total_duration += int.from_bytes(frame_duration, "little")
|
48
|
+
frames += 1
|
49
|
+
|
50
|
+
if frames == 0:
|
51
|
+
fps = 1
|
52
|
+
else:
|
53
|
+
fps = frames / total_duration * 1000
|
44
54
|
elif file_ext in (".gif", ".apng", ".png"):
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
55
|
+
total_duration = 0
|
56
|
+
frames = len([* iio.imiter(file, plugin="pillow")])
|
57
|
+
|
58
|
+
for frame in range(frames):
|
59
|
+
metadata = iio.immeta(
|
60
|
+
file, index=frame, plugin="pillow", exclude_applied=False
|
61
|
+
)
|
62
|
+
total_duration += metadata.get("duration", 1000)
|
63
|
+
fps = frames / total_duration * 1000
|
49
64
|
else:
|
50
65
|
metadata = iio.immeta(file, plugin="pyav", exclude_applied=False)
|
51
66
|
fps = metadata.get("fps", 1)
|
@@ -95,7 +110,7 @@ class CodecInfo:
|
|
95
110
|
if file_ext == ".webp":
|
96
111
|
frames = Image.open(file).n_frames
|
97
112
|
else:
|
98
|
-
frames = len(iio.
|
113
|
+
frames = frames = len([* iio.imiter(file, plugin="pyav")])
|
99
114
|
|
100
115
|
return frames
|
101
116
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: sticker-convert
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.9
|
4
4
|
Summary: Convert (animated) stickers to/from WhatsApp, Telegram, Signal, Line, Kakao, iMessage. Written in Python.
|
5
5
|
Author-email: laggykiller <chaudominic2@gmail.com>
|
6
6
|
Maintainer-email: laggykiller <chaudominic2@gmail.com>
|
@@ -367,7 +367,7 @@ License-File: LICENSE
|
|
367
367
|
Requires-Dist: apngasm-python ~=1.2.1
|
368
368
|
Requires-Dist: pyav ~=11.4.1
|
369
369
|
Requires-Dist: beautifulsoup4 ~=4.12.2
|
370
|
-
Requires-Dist: rookiepy ~=0.3.
|
370
|
+
Requires-Dist: rookiepy ~=0.3.4
|
371
371
|
Requires-Dist: imageio ~=2.33.1
|
372
372
|
Requires-Dist: memory-tempfile ~=2.2.3
|
373
373
|
Requires-Dist: numpy ~=1.26.2
|
@@ -1,4 +1,4 @@
|
|
1
|
-
sticker_convert/__init__.py,sha256=
|
1
|
+
sticker_convert/__init__.py,sha256=zf1bu4kQQP4LSB6ob4bAcE49gUjCSK8vwKnkF_7mnPc,66
|
2
2
|
sticker_convert/__main__.py,sha256=W3n9SprqoDQxaWDAqLVA7DiavMdbPLVdtbASTKSpZS0,546
|
3
3
|
sticker_convert/cli.py,sha256=21D5lAghcB3f5V7vk_qS6Di-NtGlH1ilAqDCPpzVUak,16534
|
4
4
|
sticker_convert/converter.py,sha256=k4wy8nYtUFaEFxQ6QRPWPUyAorGgRIWQ0WLElsnKTXw,16780
|
@@ -74,19 +74,19 @@ sticker_convert/utils/fake_cb_msg.py,sha256=LYHWKqjL4GdNG2HUCbvVNsRjQOErJBXsJS-k
|
|
74
74
|
sticker_convert/utils/url_detect.py,sha256=x163bVIH4rEimozvFHMC-XBmxyecf3qpBjJIBt8WPeE,793
|
75
75
|
sticker_convert/utils/auth/get_kakao_auth.py,sha256=Q3CxzDqzoo9vf_bsbmpKZXeQODEXQ5leijKjjMt2Gv8,9306
|
76
76
|
sticker_convert/utils/auth/get_line_auth.py,sha256=pKe2N3QLTyB0wWBpkD9rlDBqHK7LZ5hnAmfPH7XVmFI,1211
|
77
|
-
sticker_convert/utils/auth/get_signal_auth.py,sha256=
|
77
|
+
sticker_convert/utils/auth/get_signal_auth.py,sha256=19rv5JCzFD8GOBhR2ThW5MLFWOxiDxJZk7rK8Qo9zME,12330
|
78
78
|
sticker_convert/utils/files/cache_store.py,sha256=lNS6ItZ3lwNa7NipkDo7n0wIoAf728dcRV0r0ohmM3s,730
|
79
79
|
sticker_convert/utils/files/dir_utils.py,sha256=_jDyyPTVQXiVr4dJhPFaXqaKvch_MWLngwH7eZfezv4,1861
|
80
80
|
sticker_convert/utils/files/json_manager.py,sha256=BBndjSY5kvjxurOpnDI2DRsKoLrNBTf5HoGfUqlf-4Y,503
|
81
|
-
sticker_convert/utils/files/metadata_handler.py,sha256=
|
81
|
+
sticker_convert/utils/files/metadata_handler.py,sha256=KIy8j89DMBW7-gpL9jqhzz96GgBvPHsRYegHXemk_mY,8346
|
82
82
|
sticker_convert/utils/files/run_bin.py,sha256=4c8y5c_2wUfm0hbJSOGFcezpW5BVqM5_e9aliPbxvwo,1632
|
83
83
|
sticker_convert/utils/media/apple_png_normalize.py,sha256=YGrZ8pZvgfhw8dW-0gf7XcXk_R82lJTX-oTo6SsB7uY,3719
|
84
|
-
sticker_convert/utils/media/codec_info.py,sha256=
|
84
|
+
sticker_convert/utils/media/codec_info.py,sha256=GEfpA3OPNfB9pnsj6sFeVGFBJ34_etkmEAWaTXcnoJ4,4265
|
85
85
|
sticker_convert/utils/media/decrypt_kakao.py,sha256=gMz64vIGEIPAl4FFWuUbPMHE7vExr46ZFpzMoukvwws,1918
|
86
86
|
sticker_convert/utils/media/format_verify.py,sha256=7WvvDSFDkyG1WlkXKqVbmPjKiyEedtqivZcCqSNziD8,6179
|
87
|
-
sticker_convert-2.1.
|
88
|
-
sticker_convert-2.1.
|
89
|
-
sticker_convert-2.1.
|
90
|
-
sticker_convert-2.1.
|
91
|
-
sticker_convert-2.1.
|
92
|
-
sticker_convert-2.1.
|
87
|
+
sticker_convert-2.1.9.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
88
|
+
sticker_convert-2.1.9.dist-info/METADATA,sha256=yyJDvxP8jqAbH6WM_UbUb3aqBdwNF5ayZ6td6gxk88o,44696
|
89
|
+
sticker_convert-2.1.9.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
90
|
+
sticker_convert-2.1.9.dist-info/entry_points.txt,sha256=MNJ7XyC--ugxi5jS1nzjDLGnxCyLuaGdsVLnJhDHCqs,66
|
91
|
+
sticker_convert-2.1.9.dist-info/top_level.txt,sha256=r9vfnB0l1ZnH5pTH5RvkobnK3Ow9m0RsncaOMAtiAtk,16
|
92
|
+
sticker_convert-2.1.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|