sticker-convert 2.13.3.0__py3-none-any.whl → 2.17.0.0__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/__main__.py +24 -27
- sticker_convert/auth/__init__.py +0 -0
- sticker_convert/auth/auth_base.py +19 -0
- sticker_convert/{utils/auth/get_discord_auth.py → auth/auth_discord.py} +149 -118
- sticker_convert/{utils/auth/get_kakao_auth.py → auth/auth_kakao_android_login.py} +331 -330
- sticker_convert/auth/auth_kakao_desktop_login.py +327 -0
- sticker_convert/{utils/auth/get_kakao_desktop_auth.py → auth/auth_kakao_desktop_memdump.py} +281 -263
- sticker_convert/{utils/auth/get_line_auth.py → auth/auth_line.py} +98 -80
- sticker_convert/{utils/auth/get_signal_auth.py → auth/auth_signal.py} +139 -135
- sticker_convert/auth/auth_telethon.py +161 -0
- sticker_convert/{utils/auth/get_viber_auth.py → auth/auth_viber.py} +250 -235
- sticker_convert/{utils/auth → auth}/telegram_api.py +736 -675
- sticker_convert/cli.py +623 -608
- sticker_convert/converter.py +1093 -1084
- sticker_convert/definitions.py +4 -0
- sticker_convert/downloaders/download_band.py +111 -110
- sticker_convert/downloaders/download_base.py +171 -166
- sticker_convert/downloaders/download_discord.py +92 -91
- sticker_convert/downloaders/download_kakao.py +417 -404
- sticker_convert/downloaders/download_line.py +484 -475
- sticker_convert/downloaders/download_ogq.py +80 -79
- sticker_convert/downloaders/download_signal.py +108 -105
- sticker_convert/downloaders/download_telegram.py +56 -55
- sticker_convert/downloaders/download_viber.py +121 -120
- sticker_convert/gui.py +788 -873
- sticker_convert/gui_components/frames/comp_frame.py +180 -166
- sticker_convert/gui_components/frames/config_frame.py +156 -113
- sticker_convert/gui_components/frames/control_frame.py +32 -30
- sticker_convert/gui_components/frames/cred_frame.py +232 -233
- sticker_convert/gui_components/frames/input_frame.py +139 -137
- sticker_convert/gui_components/frames/output_frame.py +112 -110
- sticker_convert/gui_components/frames/right_clicker.py +25 -23
- sticker_convert/gui_components/windows/advanced_compression_window.py +757 -757
- sticker_convert/gui_components/windows/base_window.py +7 -2
- sticker_convert/gui_components/windows/discord_get_auth_window.py +79 -82
- sticker_convert/gui_components/windows/kakao_get_auth_window.py +511 -321
- sticker_convert/gui_components/windows/line_get_auth_window.py +94 -102
- sticker_convert/gui_components/windows/signal_get_auth_window.py +84 -89
- sticker_convert/gui_components/windows/viber_get_auth_window.py +168 -168
- sticker_convert/ios-message-stickers-template/.github/FUNDING.yml +3 -3
- sticker_convert/ios-message-stickers-template/README.md +10 -10
- sticker_convert/ios-message-stickers-template/stickers/Info.plist +43 -43
- sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Info.plist +31 -31
- sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Contents.json +6 -6
- sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Contents.json +20 -20
- sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 1.sticker/Contents.json +9 -9
- sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 2.sticker/Contents.json +9 -9
- sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 3.sticker/Contents.json +9 -9
- sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Contents.json +91 -91
- sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.pbxproj +364 -364
- sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -7
- sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
- sticker_convert/ios-message-stickers-template/stickers.xcodeproj/xcuserdata/niklaspeterson.xcuserdatad/xcschemes/xcschememanagement.plist +14 -14
- sticker_convert/job.py +166 -130
- sticker_convert/job_option.py +1 -0
- sticker_convert/locales/en_US/LC_MESSAGES/base.mo +0 -0
- sticker_convert/locales/ja_JP/LC_MESSAGES/base.mo +0 -0
- sticker_convert/locales/zh_CN/LC_MESSAGES/base.mo +0 -0
- sticker_convert/locales/zh_TW/LC_MESSAGES/base.mo +0 -0
- sticker_convert/py.typed +0 -0
- sticker_convert/resources/NotoColorEmoji.ttf +0 -0
- sticker_convert/resources/help.ja_JP.json +88 -0
- sticker_convert/resources/help.json +10 -7
- sticker_convert/resources/help.zh_CN.json +88 -0
- sticker_convert/resources/help.zh_TW.json +88 -0
- sticker_convert/resources/input.ja_JP.json +74 -0
- sticker_convert/resources/input.json +121 -121
- sticker_convert/resources/input.zh_CN.json +74 -0
- sticker_convert/resources/input.zh_TW.json +74 -0
- sticker_convert/resources/output.ja_JP.json +38 -0
- sticker_convert/resources/output.zh_CN.json +38 -0
- sticker_convert/resources/output.zh_TW.json +38 -0
- sticker_convert/uploaders/compress_wastickers.py +186 -177
- sticker_convert/uploaders/upload_base.py +44 -35
- sticker_convert/uploaders/upload_signal.py +218 -203
- sticker_convert/uploaders/upload_telegram.py +353 -338
- sticker_convert/uploaders/upload_viber.py +178 -169
- sticker_convert/uploaders/xcode_imessage.py +295 -286
- sticker_convert/utils/callback.py +238 -6
- sticker_convert/utils/emoji.py +16 -4
- sticker_convert/utils/files/json_resources_loader.py +24 -19
- sticker_convert/utils/files/metadata_handler.py +3 -3
- sticker_convert/utils/translate.py +108 -0
- sticker_convert/utils/url_detect.py +40 -37
- sticker_convert/version.py +1 -1
- {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/METADATA +89 -74
- {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/RECORD +91 -74
- sticker_convert/utils/auth/telethon_setup.py +0 -97
- sticker_convert/utils/singletons.py +0 -18
- {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/WHEEL +0 -0
- {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/entry_points.txt +0 -0
- {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/licenses/LICENSE +0 -0
- {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/top_level.txt +0 -0
sticker_convert/__main__.py
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def main() -> None:
|
|
5
|
-
import multiprocessing
|
|
6
|
-
import sys
|
|
7
|
-
|
|
8
|
-
from sticker_convert.
|
|
9
|
-
|
|
10
|
-
multiprocessing.freeze_support()
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if __name__ == "__main__":
|
|
27
|
-
main()
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def main() -> None:
|
|
5
|
+
import multiprocessing
|
|
6
|
+
import sys
|
|
7
|
+
|
|
8
|
+
from sticker_convert.utils.translate import I
|
|
9
|
+
|
|
10
|
+
multiprocessing.freeze_support()
|
|
11
|
+
|
|
12
|
+
if len(sys.argv) == 1:
|
|
13
|
+
print(I("Launching GUI..."))
|
|
14
|
+
from sticker_convert.gui import GUI
|
|
15
|
+
|
|
16
|
+
GUI().gui()
|
|
17
|
+
else:
|
|
18
|
+
from sticker_convert.cli import CLI
|
|
19
|
+
|
|
20
|
+
CLI().cli()
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
if __name__ == "__main__":
|
|
24
|
+
main()
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
from sticker_convert.job_option import CredOption
|
|
5
|
+
from sticker_convert.utils.callback import CallbackCli, CallbackProtocol
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AuthBase:
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
opt_cred: CredOption,
|
|
12
|
+
cb: Optional[CallbackProtocol] = None,
|
|
13
|
+
) -> None:
|
|
14
|
+
self.opt_cred = opt_cred
|
|
15
|
+
self.cb: CallbackProtocol
|
|
16
|
+
if cb is None:
|
|
17
|
+
self.cb = CallbackCli()
|
|
18
|
+
else:
|
|
19
|
+
self.cb = cb
|
|
@@ -1,118 +1,149 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
import json
|
|
3
|
-
import os
|
|
4
|
-
import platform
|
|
5
|
-
import shutil
|
|
6
|
-
import time
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
from sticker_convert.
|
|
12
|
-
from sticker_convert.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
self.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(
|
|
34
|
-
os.path.expandvars("%localappdata%/
|
|
35
|
-
"
|
|
36
|
-
),
|
|
37
|
-
(
|
|
38
|
-
os.path.expandvars("%localappdata%/
|
|
39
|
-
"
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
discord_dirs = (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
import platform
|
|
5
|
+
import shutil
|
|
6
|
+
import time
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any, Optional, Tuple
|
|
9
|
+
from urllib.parse import urlparse
|
|
10
|
+
|
|
11
|
+
from sticker_convert.auth.auth_base import AuthBase
|
|
12
|
+
from sticker_convert.definitions import CONFIG_DIR
|
|
13
|
+
from sticker_convert.utils.chrome_remotedebug import CRD
|
|
14
|
+
from sticker_convert.utils.process import find_pid_by_name, killall
|
|
15
|
+
from sticker_convert.utils.translate import I
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class AuthDiscord(AuthBase):
|
|
19
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
20
|
+
self.OK_MSG = I("Got token successfully:\ntoken={}")
|
|
21
|
+
self.FAIL_MSG = I("Failed to get token")
|
|
22
|
+
super().__init__(*args, **kwargs)
|
|
23
|
+
chromedriver_download_dir = CONFIG_DIR / "bin"
|
|
24
|
+
os.makedirs(chromedriver_download_dir, exist_ok=True)
|
|
25
|
+
|
|
26
|
+
self.chromedriver_download_dir = chromedriver_download_dir
|
|
27
|
+
|
|
28
|
+
def get_discord_bin_path(self) -> Optional[str]:
|
|
29
|
+
discord_bin: Optional[str]
|
|
30
|
+
if platform.system() == "Windows":
|
|
31
|
+
discord_win_dirs: Tuple[Tuple[str, str], ...]
|
|
32
|
+
discord_win_dirs = (
|
|
33
|
+
(
|
|
34
|
+
os.path.expandvars("%localappdata%/Discord"),
|
|
35
|
+
"Discord.exe",
|
|
36
|
+
),
|
|
37
|
+
(
|
|
38
|
+
os.path.expandvars("%localappdata%/DiscordCanary"),
|
|
39
|
+
"DiscordCanary.exe",
|
|
40
|
+
),
|
|
41
|
+
(
|
|
42
|
+
os.path.expandvars("%localappdata%/DiscordPTB"),
|
|
43
|
+
"DiscordPTB.exe",
|
|
44
|
+
),
|
|
45
|
+
)
|
|
46
|
+
for discord_dir, discord_bin in discord_win_dirs:
|
|
47
|
+
app_dir: Optional[str] = None
|
|
48
|
+
chrome_path: Optional[str] = None
|
|
49
|
+
if os.path.isdir(discord_dir) is False:
|
|
50
|
+
continue
|
|
51
|
+
for i in [j for j in os.listdir(discord_dir) if j.startswith("app-")]:
|
|
52
|
+
app_dir = os.path.join(discord_dir, i)
|
|
53
|
+
chrome_path = os.path.join(app_dir, discord_bin)
|
|
54
|
+
if os.path.isfile(chrome_path):
|
|
55
|
+
return chrome_path
|
|
56
|
+
else:
|
|
57
|
+
discord_dirs: Tuple[Optional[str], ...]
|
|
58
|
+
if platform.system() == "Darwin":
|
|
59
|
+
discord_dirs = (
|
|
60
|
+
"/Applications/Discord.app/Contents/MacOS/Discord",
|
|
61
|
+
"/Applications/Discord Canary.app/Contents/MacOS/Discord Canary",
|
|
62
|
+
"/Applications/Discord PTB.app/Contents/MacOS/Discord PTB",
|
|
63
|
+
)
|
|
64
|
+
else:
|
|
65
|
+
discord_dirs = (
|
|
66
|
+
shutil.which("discord"),
|
|
67
|
+
shutil.which("discord-canary"),
|
|
68
|
+
shutil.which("discord-ptb"),
|
|
69
|
+
)
|
|
70
|
+
for discord_bin in discord_dirs:
|
|
71
|
+
if discord_bin is not None and os.path.isfile(discord_bin):
|
|
72
|
+
return discord_bin
|
|
73
|
+
return None
|
|
74
|
+
|
|
75
|
+
def get_cred(self) -> Tuple[Optional[str], str]:
|
|
76
|
+
msg = I("Getting Discord authorization token...")
|
|
77
|
+
self.cb.put(("msg_dynamic", (msg,), None))
|
|
78
|
+
|
|
79
|
+
using_discord_app = False
|
|
80
|
+
chrome_path = self.get_discord_bin_path()
|
|
81
|
+
if chrome_path is not None:
|
|
82
|
+
using_discord_app = True
|
|
83
|
+
else:
|
|
84
|
+
chrome_path = CRD.get_chromium_path()
|
|
85
|
+
if chrome_path is None:
|
|
86
|
+
self.cb.put(("msg_dynamic", (None,), None))
|
|
87
|
+
return (
|
|
88
|
+
None,
|
|
89
|
+
I("Please install Discord Desktop or Chrome/Chromium and try again"),
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
token = None
|
|
93
|
+
|
|
94
|
+
if find_pid_by_name(Path(chrome_path).name):
|
|
95
|
+
response = self.cb.put(
|
|
96
|
+
(
|
|
97
|
+
"ask_bool",
|
|
98
|
+
(
|
|
99
|
+
I("All {} will be closed. Continue?").format(
|
|
100
|
+
Path(chrome_path).name
|
|
101
|
+
),
|
|
102
|
+
),
|
|
103
|
+
None,
|
|
104
|
+
)
|
|
105
|
+
)
|
|
106
|
+
if response is True:
|
|
107
|
+
killall(Path(chrome_path).name.lower())
|
|
108
|
+
else:
|
|
109
|
+
return None, self.FAIL_MSG
|
|
110
|
+
|
|
111
|
+
crd = CRD(chrome_path)
|
|
112
|
+
while True:
|
|
113
|
+
crd.connect()
|
|
114
|
+
if using_discord_app is False:
|
|
115
|
+
crd.navigate("https://discord.com/channels/@me")
|
|
116
|
+
break
|
|
117
|
+
else:
|
|
118
|
+
curr_url = crd.get_curr_url()
|
|
119
|
+
netloc = urlparse(curr_url).netloc
|
|
120
|
+
if netloc in ("discordapp.com", "discord.com"):
|
|
121
|
+
break
|
|
122
|
+
time.sleep(1)
|
|
123
|
+
|
|
124
|
+
while True:
|
|
125
|
+
try:
|
|
126
|
+
if using_discord_app:
|
|
127
|
+
r = crd.exec_js(
|
|
128
|
+
"(webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken();"
|
|
129
|
+
)
|
|
130
|
+
else:
|
|
131
|
+
r = crd.exec_js(
|
|
132
|
+
"const iframe=document.createElement('iframe');JSON.parse(document.body.appendChild(iframe).contentWindow.localStorage.token);"
|
|
133
|
+
)
|
|
134
|
+
except RuntimeError:
|
|
135
|
+
break
|
|
136
|
+
if (
|
|
137
|
+
json.loads(r).get("result", {}).get("result", {}).get("type", "")
|
|
138
|
+
== "string"
|
|
139
|
+
):
|
|
140
|
+
token = json.loads(r)["result"]["result"]["value"]
|
|
141
|
+
break
|
|
142
|
+
time.sleep(1)
|
|
143
|
+
crd.close()
|
|
144
|
+
|
|
145
|
+
self.cb.put(("msg_dynamic", (None,), None))
|
|
146
|
+
if token is None:
|
|
147
|
+
return None, self.FAIL_MSG
|
|
148
|
+
|
|
149
|
+
return token, self.OK_MSG.format(token)
|