sticker-convert 2.12.2__py3-none-any.whl → 2.12.3__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/converter.py +2 -1
- sticker_convert/downloaders/download_viber.py +13 -3
- sticker_convert/utils/auth/get_discord_auth.py +4 -1
- sticker_convert/utils/auth/telegram_api.py +2 -2
- sticker_convert/utils/chrome_remotedebug.py +31 -41
- sticker_convert/version.py +1 -1
- {sticker_convert-2.12.2.dist-info → sticker_convert-2.12.3.dist-info}/METADATA +2 -1
- {sticker_convert-2.12.2.dist-info → sticker_convert-2.12.3.dist-info}/RECORD +12 -12
- {sticker_convert-2.12.2.dist-info → sticker_convert-2.12.3.dist-info}/WHEEL +0 -0
- {sticker_convert-2.12.2.dist-info → sticker_convert-2.12.3.dist-info}/entry_points.txt +0 -0
- {sticker_convert-2.12.2.dist-info → sticker_convert-2.12.3.dist-info}/licenses/LICENSE +0 -0
- {sticker_convert-2.12.2.dist-info → sticker_convert-2.12.3.dist-info}/top_level.txt +0 -0
sticker_convert/converter.py
CHANGED
@@ -438,12 +438,13 @@ class StickerConvert:
|
|
438
438
|
chrome_path = CRD.get_chrome_path()
|
439
439
|
args = [
|
440
440
|
"--headless",
|
441
|
+
"--kiosk",
|
441
442
|
"--disable-extensions",
|
442
443
|
"--disable-infobars",
|
443
444
|
"--disable-gpu",
|
444
445
|
"--disable-gpu-rasterization",
|
445
446
|
"--hide-scrollbars",
|
446
|
-
f"--window-size={width +
|
447
|
+
f"--window-size={width + 200},{height + 200}",
|
447
448
|
"about:blank",
|
448
449
|
]
|
449
450
|
if chrome_path is None:
|
@@ -19,7 +19,7 @@ class DownloadViber(DownloadBase):
|
|
19
19
|
# def __init__(self, *args: Any, **kwargs: Any) -> None:
|
20
20
|
# super().__init__(*args, **kwargs)
|
21
21
|
|
22
|
-
def get_pack_info(self, url: str) -> Optional[Tuple[str, str, str]]:
|
22
|
+
def get_pack_info(self, url: str) -> Optional[Tuple[str, str, str, str]]:
|
23
23
|
r = requests.get(url, allow_redirects=True)
|
24
24
|
soup = BeautifulSoup(r.text, "html.parser")
|
25
25
|
|
@@ -42,8 +42,17 @@ class DownloadViber(DownloadBase):
|
|
42
42
|
first_sticker_url = cast(str, pack_dict["stickerFirstItemUrl"])
|
43
43
|
zip_url = "/".join(first_sticker_url.split("/")[:-1]) + ".zip"
|
44
44
|
pack_id = pack_dict["id"].split(".")[-1]
|
45
|
+
if is_custom:
|
46
|
+
cover_url = (
|
47
|
+
"https://custom-sticker-pack.cdn.viber.com/custom-stickers/{}/thumb.png"
|
48
|
+
)
|
49
|
+
else:
|
50
|
+
cover_url = (
|
51
|
+
"https://sm-content.viber.com/static/images/product/{}/sticker.png"
|
52
|
+
)
|
53
|
+
cover_url = cover_url.format(pack_dict["id"])
|
45
54
|
|
46
|
-
return title, zip_url, pack_id
|
55
|
+
return title, zip_url, cover_url, pack_id
|
47
56
|
|
48
57
|
def decompress(
|
49
58
|
self, zip_file: bytes, exts: Optional[Tuple[str, ...]] = None
|
@@ -84,7 +93,7 @@ class DownloadViber(DownloadBase):
|
|
84
93
|
if pack_info is None:
|
85
94
|
self.cb.put("Download failed: Cannot get pack info")
|
86
95
|
return 0, 0
|
87
|
-
title, zip_url, pack_id = pack_info
|
96
|
+
title, zip_url, cover_url, pack_id = pack_info
|
88
97
|
|
89
98
|
anim_url = f"https://content.cdn.viber.com/stickers/ASVG/{pack_id}.zip"
|
90
99
|
anim_file = self.download_file(anim_url)
|
@@ -94,6 +103,7 @@ class DownloadViber(DownloadBase):
|
|
94
103
|
count += self.decompress(zip_file, (".mp3",))
|
95
104
|
else:
|
96
105
|
count = self.decompress(zip_file, (".mp3", ".png"))
|
106
|
+
self.download_file(cover_url, self.out_dir / "cover.png")
|
97
107
|
|
98
108
|
MetadataHandler.set_metadata(self.out_dir, title=title)
|
99
109
|
|
@@ -74,7 +74,10 @@ class GetDiscordAuth:
|
|
74
74
|
else:
|
75
75
|
chrome_path = CRD.get_chrome_path()
|
76
76
|
if chrome_path is None:
|
77
|
-
return
|
77
|
+
return (
|
78
|
+
None,
|
79
|
+
"Please install Discord Desktop or Chrome/Chromium and try again",
|
80
|
+
)
|
78
81
|
|
79
82
|
token = None
|
80
83
|
if using_discord_app:
|
@@ -388,8 +388,8 @@ class TelethonAPI(TelegramAPI):
|
|
388
388
|
else:
|
389
389
|
sent_message = cast(
|
390
390
|
Message,
|
391
|
-
await self.client.send_file("Stickers", msg, force_document=True),
|
392
|
-
)
|
391
|
+
await self.client.send_file("Stickers", msg, force_document=True), # type: ignore
|
392
|
+
)
|
393
393
|
|
394
394
|
for _ in range(5):
|
395
395
|
# https://core.telegram.org/bots/faq#my-bot-is-hitting-limits-how-do-i-avoid-this
|
@@ -8,8 +8,9 @@ import shutil
|
|
8
8
|
import socket
|
9
9
|
import subprocess
|
10
10
|
import time
|
11
|
-
from typing import Any, Dict, List, Optional, Union, cast
|
11
|
+
from typing import Any, Dict, List, Optional, Tuple, Union, cast
|
12
12
|
|
13
|
+
import browsers # type: ignore
|
13
14
|
import requests
|
14
15
|
import websocket
|
15
16
|
from PIL import Image
|
@@ -19,6 +20,23 @@ from PIL import Image
|
|
19
20
|
# https://chromedevtools.github.io/devtools-protocol/
|
20
21
|
|
21
22
|
|
23
|
+
BROWSER_PREF = [
|
24
|
+
"chrome",
|
25
|
+
"chrome-canary",
|
26
|
+
"chromium",
|
27
|
+
"msedge",
|
28
|
+
"msedge-beta",
|
29
|
+
"msedge-dev",
|
30
|
+
"msedge-canary",
|
31
|
+
"brave",
|
32
|
+
"brave-beta",
|
33
|
+
"brave-nightly",
|
34
|
+
"opera",
|
35
|
+
"opera-beta",
|
36
|
+
"opera-developer",
|
37
|
+
]
|
38
|
+
|
39
|
+
|
22
40
|
def get_free_port() -> int:
|
23
41
|
with socket.socket() as sock:
|
24
42
|
sock.bind(("", 0))
|
@@ -66,47 +84,19 @@ class CRD:
|
|
66
84
|
|
67
85
|
@staticmethod
|
68
86
|
def get_chrome_path() -> Optional[str]:
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
chrome_x64 = f"{os.environ.get('PROGRAMW6432') or os.environ.get('PROGRAMFILES')}\\Google\\Chrome\\Application"
|
80
|
-
chrome_x86 = (
|
81
|
-
f"{os.environ.get('PROGRAMFILES(X86)')}\\Google\\Chrome\\Application"
|
82
|
-
)
|
83
|
-
|
84
|
-
chrome_dir = (
|
85
|
-
chrome_x64
|
86
|
-
if os.path.isdir(chrome_x64)
|
87
|
-
else chrome_x86
|
88
|
-
if os.path.isdir(chrome_x86)
|
89
|
-
else None
|
90
|
-
)
|
91
|
-
|
92
|
-
if chrome_dir is None:
|
93
|
-
return None
|
94
|
-
|
95
|
-
return chrome_dir + "\\chrome.exe"
|
96
|
-
|
97
|
-
else:
|
98
|
-
for executable in (
|
99
|
-
"google-chrome",
|
100
|
-
"google-chrome-stable",
|
101
|
-
"google-chrome-beta",
|
102
|
-
"google-chrome-dev",
|
103
|
-
"chromium-browser",
|
104
|
-
"chromium",
|
105
|
-
):
|
106
|
-
chrome_bin = shutil.which(executable)
|
107
|
-
if chrome_bin is not None:
|
108
|
-
return chrome_bin
|
87
|
+
bs: List[Tuple[int, str]] = []
|
88
|
+
for b in browsers.browsers():
|
89
|
+
browser_type = b["browser_type"]
|
90
|
+
path = b["path"]
|
91
|
+
try:
|
92
|
+
rank = BROWSER_PREF.index(browser_type)
|
93
|
+
except ValueError:
|
94
|
+
continue
|
95
|
+
bs.append((rank, path))
|
96
|
+
if len(bs) == 0:
|
109
97
|
return None
|
98
|
+
bs = sorted(bs, key=lambda x: x[0])
|
99
|
+
return bs[0][1]
|
110
100
|
|
111
101
|
def connect(self, target_id: int = 0):
|
112
102
|
self.cmd_id = 1
|
sticker_convert/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: sticker-convert
|
3
|
-
Version: 2.12.
|
3
|
+
Version: 2.12.3
|
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>
|
@@ -376,6 +376,7 @@ Requires-Dist: memory-tempfile~=2.2.3
|
|
376
376
|
Requires-Dist: mergedeep~=1.3.4
|
377
377
|
Requires-Dist: numpy>=1.22.4
|
378
378
|
Requires-Dist: Pillow~=11.1.0
|
379
|
+
Requires-Dist: pybrowsers~=0.7.0
|
379
380
|
Requires-Dist: pyoxipng~=9.0.0
|
380
381
|
Requires-Dist: python-telegram-bot~=22.0
|
381
382
|
Requires-Dist: psutil~=7.0.0
|
@@ -1,12 +1,12 @@
|
|
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=MWzq9QJJ7HYBD73DmSgRIPo-u58mTGEIoUUpJKNjI0Q,22358
|
4
|
-
sticker_convert/converter.py,sha256=
|
4
|
+
sticker_convert/converter.py,sha256=FVHsWKIIzewkxZ2apOFgPqEvzFSXPmQeAcnFEY7vYDM,39446
|
5
5
|
sticker_convert/definitions.py,sha256=BqROmOvqIqw8ANaqZXIxJAXGD0HgjAvCfFouQ4SaWHc,2254
|
6
6
|
sticker_convert/gui.py,sha256=D9L-lFif4P4MANglis_wpjkzlUuGPuq8AybWGyPVP8E,33824
|
7
7
|
sticker_convert/job.py,sha256=gEd6yF8WPUR1_7q9SVhnwdD5usrDxwowNnR5q9uS8Yc,28011
|
8
8
|
sticker_convert/job_option.py,sha256=NysZtKVVG7EzRkLnVaeYJY0uNlYKFmjoststB1cvVrY,8020
|
9
|
-
sticker_convert/version.py,sha256=
|
9
|
+
sticker_convert/version.py,sha256=8-CYgCWklTwkUtd4SiyvYPiHKcvCUejjHFpw4ScOsls,47
|
10
10
|
sticker_convert/downloaders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
11
|
sticker_convert/downloaders/download_base.py,sha256=MI5pCT_tkfoaFlrD1oNynDj1Rv1CK0APuNVElTEAEis,5110
|
12
12
|
sticker_convert/downloaders/download_discord.py,sha256=6AFpLAYL2hRvVcsqUtzDUC31U66U02ZcnKXDnZRi2jk,3496
|
@@ -14,7 +14,7 @@ sticker_convert/downloaders/download_kakao.py,sha256=-k9uTo_vn5CUjb0XPCKPmtYfftw
|
|
14
14
|
sticker_convert/downloaders/download_line.py,sha256=c-hTzEarGQP0b-pnPl29NuSKcaZWUeRo_94YpJzz72M,17911
|
15
15
|
sticker_convert/downloaders/download_signal.py,sha256=3wv-BLd4qggly4AdtwV8f3vUpCVZ-8GnoPLoWngY3Pk,3728
|
16
16
|
sticker_convert/downloaders/download_telegram.py,sha256=iGmOcVjU2Ai19t1lyDY2JhQIc--O5XMyNCGXZAA4DVY,2028
|
17
|
-
sticker_convert/downloaders/download_viber.py,sha256=
|
17
|
+
sticker_convert/downloaders/download_viber.py,sha256=SFnyaVEd_33J1KvRhcHDJqnLKGsbLMeA2NomVHm2ulM,4226
|
18
18
|
sticker_convert/gui_components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
19
|
sticker_convert/gui_components/gui_utils.py,sha256=okho2cA1Scem_m6rPiYifreFzpFrM21-yUkiAv64EUI,3431
|
20
20
|
sticker_convert/gui_components/frames/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -85,17 +85,17 @@ sticker_convert/uploaders/upload_telegram.py,sha256=WlUyLJlW83XZz6RhA76jHMXA6TNU
|
|
85
85
|
sticker_convert/uploaders/upload_viber.py,sha256=_vOK0UgP7V7ZeFG6pR3sVf3A744Q6J19qzO-2hDvt5w,6583
|
86
86
|
sticker_convert/uploaders/xcode_imessage.py,sha256=iTTT8gDYOTNkKqXeSWUBuWfxu7xeE418t2Z1YQFR5L0,11365
|
87
87
|
sticker_convert/utils/callback.py,sha256=spYUGlklOs1yPZAxoqwOWgR1sdimpfM8a27if3TaVYk,6155
|
88
|
-
sticker_convert/utils/chrome_remotedebug.py,sha256=
|
88
|
+
sticker_convert/utils/chrome_remotedebug.py,sha256=uzUBlUtuO0cRcDxO7hnPWvbdt5NJBnCXvAnStK2zAVQ,6445
|
89
89
|
sticker_convert/utils/emoji.py,sha256=AqB26JY-PkYzNwPLReSnqLiQKe-bR9UXnLclAbgubJ8,367
|
90
90
|
sticker_convert/utils/process.py,sha256=EAQZ9WpiKmkvToIv8G1HNY4V7m0jXyyePTmeP2XOZzE,4688
|
91
91
|
sticker_convert/utils/url_detect.py,sha256=vCbhQbcW1X_UtdfQlICGY8pMX34KQ6sCtDJZbp0NrSg,876
|
92
|
-
sticker_convert/utils/auth/get_discord_auth.py,sha256=
|
92
|
+
sticker_convert/utils/auth/get_discord_auth.py,sha256=MeyLzB8hlMTv8l2-6HBW45hppwogSH2gyI1L-VAOEkM,4273
|
93
93
|
sticker_convert/utils/auth/get_kakao_auth.py,sha256=Wok5sp0GGBgTwwlfYB7lVq82ndBAOGTcqsWEaWAXFNE,10760
|
94
94
|
sticker_convert/utils/auth/get_kakao_desktop_auth.py,sha256=BBfFI08cVOmi6akenQwMI0Uiatmn76wI8QYHnbvopxg,5809
|
95
95
|
sticker_convert/utils/auth/get_line_auth.py,sha256=8l8ha2vQmk3rHGvDE7PkcxQXbH3oe62LKbI3qVUtvqc,2196
|
96
96
|
sticker_convert/utils/auth/get_signal_auth.py,sha256=oDTcIUcRM8_zfmR6UoBvzBhIscwLRe7n2zw4aw0j8_Q,4564
|
97
97
|
sticker_convert/utils/auth/get_viber_auth.py,sha256=mUTrcxq5bTrzSXEVaeTPqVQIdZdwvIhrbMgBUb7dU30,8173
|
98
|
-
sticker_convert/utils/auth/telegram_api.py,sha256=
|
98
|
+
sticker_convert/utils/auth/telegram_api.py,sha256=hX9fT0Pp8yMxcKSXLe9Mvy12mQ_rWj-KTyamABI8YWA,24232
|
99
99
|
sticker_convert/utils/auth/telethon_setup.py,sha256=QW0RAP3KwnxK9ZHmCo_iGqc1NiskOzsGa1kcmPT9PsQ,2972
|
100
100
|
sticker_convert/utils/files/cache_store.py,sha256=etfe614OAhAyrnM5fGeESKq6R88YLNqkqkxSzEmZ0V0,1047
|
101
101
|
sticker_convert/utils/files/json_manager.py,sha256=Vr6pZJdLMkrJJWN99210aduVHb0ILyf0SSTaw4TZqgc,541
|
@@ -107,9 +107,9 @@ sticker_convert/utils/media/apple_png_normalize.py,sha256=LbrQhc7LlYX4I9ek4XJsZE
|
|
107
107
|
sticker_convert/utils/media/codec_info.py,sha256=_F_iV3k2GYtb8vYZUSKrWl9E7XEW6LDywbnJ-DM6kbk,16476
|
108
108
|
sticker_convert/utils/media/decrypt_kakao.py,sha256=4wq9ZDRnFkx1WmFZnyEogBofiLGsWQM_X69HlA36578,1947
|
109
109
|
sticker_convert/utils/media/format_verify.py,sha256=oM32P186tWe9YxvBQRPr8D3FEmBN3b2rEe_2S_MwxyQ,6236
|
110
|
-
sticker_convert-2.12.
|
111
|
-
sticker_convert-2.12.
|
112
|
-
sticker_convert-2.12.
|
113
|
-
sticker_convert-2.12.
|
114
|
-
sticker_convert-2.12.
|
115
|
-
sticker_convert-2.12.
|
110
|
+
sticker_convert-2.12.3.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
111
|
+
sticker_convert-2.12.3.dist-info/METADATA,sha256=bnBpAawPOvQ4air1vK1aofJ9xTGJ8LBsXqZTAEzy7TA,53517
|
112
|
+
sticker_convert-2.12.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
113
|
+
sticker_convert-2.12.3.dist-info/entry_points.txt,sha256=MNJ7XyC--ugxi5jS1nzjDLGnxCyLuaGdsVLnJhDHCqs,66
|
114
|
+
sticker_convert-2.12.3.dist-info/top_level.txt,sha256=r9vfnB0l1ZnH5pTH5RvkobnK3Ow9m0RsncaOMAtiAtk,16
|
115
|
+
sticker_convert-2.12.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|