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
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
from typing import Callable, Optional, Tuple
|
|
3
|
-
|
|
4
|
-
import anyio
|
|
5
|
-
from telethon import TelegramClient # type: ignore
|
|
6
|
-
from telethon.errors import SessionPasswordNeededError # type: ignore
|
|
7
|
-
|
|
8
|
-
from sticker_convert.definitions import CONFIG_DIR
|
|
9
|
-
from sticker_convert.job_option import CredOption
|
|
10
|
-
|
|
11
|
-
GUIDE_MSG = """1. Visit https://my.telegram.org
|
|
12
|
-
2. Login using your phone number
|
|
13
|
-
3. Go to "API development tools"
|
|
14
|
-
4. Fill form
|
|
15
|
-
- App title: sticker-convert
|
|
16
|
-
- Short name: sticker-convert
|
|
17
|
-
- URL: www.telegram.org
|
|
18
|
-
- Platform: Desktop
|
|
19
|
-
- Description: sticker-convert
|
|
20
|
-
5. Note down api_id and api_hash
|
|
21
|
-
Continue when done"""
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class TelethonSetup:
|
|
25
|
-
def __init__(
|
|
26
|
-
self, opt_cred: CredOption, cb_ask_str: Callable[..., str] = input
|
|
27
|
-
) -> None:
|
|
28
|
-
self.cb_ask_str = cb_ask_str
|
|
29
|
-
self.opt_cred = opt_cred
|
|
30
|
-
|
|
31
|
-
async def signin_async(self) -> Tuple[bool, TelegramClient, int, str]:
|
|
32
|
-
client = TelegramClient(
|
|
33
|
-
CONFIG_DIR / f"telethon-{self.opt_cred.telethon_api_id}.session",
|
|
34
|
-
self.opt_cred.telethon_api_id,
|
|
35
|
-
self.opt_cred.telethon_api_hash,
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
await client.connect()
|
|
39
|
-
authed = await client.is_user_authorized()
|
|
40
|
-
if authed is False:
|
|
41
|
-
phone_number = self.cb_ask_str("Enter phone number: ")
|
|
42
|
-
await client.send_code_request(phone_number)
|
|
43
|
-
code = self.cb_ask_str("Enter code: ")
|
|
44
|
-
try:
|
|
45
|
-
await client.sign_in(phone_number, code)
|
|
46
|
-
except SessionPasswordNeededError:
|
|
47
|
-
password = self.cb_ask_str("Enter password: ")
|
|
48
|
-
await client.sign_in(password=password)
|
|
49
|
-
authed = await client.is_user_authorized()
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
authed,
|
|
53
|
-
client,
|
|
54
|
-
self.opt_cred.telethon_api_id,
|
|
55
|
-
self.opt_cred.telethon_api_hash,
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
def guide(self) -> None:
|
|
59
|
-
self.cb_ask_str(GUIDE_MSG)
|
|
60
|
-
|
|
61
|
-
def get_api_info(self) -> bool:
|
|
62
|
-
api_id_ask = "Enter api_id: "
|
|
63
|
-
wrong_hint = ""
|
|
64
|
-
|
|
65
|
-
while True:
|
|
66
|
-
telethon_api_id = self.cb_ask_str(wrong_hint + api_id_ask)
|
|
67
|
-
if telethon_api_id == "":
|
|
68
|
-
return False
|
|
69
|
-
elif telethon_api_id.isnumeric():
|
|
70
|
-
self.opt_cred.telethon_api_id = int(telethon_api_id)
|
|
71
|
-
break
|
|
72
|
-
else:
|
|
73
|
-
wrong_hint = "Error: api_id should be numeric\n"
|
|
74
|
-
|
|
75
|
-
self.opt_cred.telethon_api_hash = self.cb_ask_str("Enter api_hash: ")
|
|
76
|
-
if self.opt_cred.telethon_api_hash == "":
|
|
77
|
-
return False
|
|
78
|
-
return True
|
|
79
|
-
|
|
80
|
-
def signin(self) -> Tuple[bool, TelegramClient, int, str]:
|
|
81
|
-
return anyio.run(self.signin_async)
|
|
82
|
-
|
|
83
|
-
def start(self) -> Tuple[bool, Optional[TelegramClient], int, str]:
|
|
84
|
-
cred_valid = False
|
|
85
|
-
if self.opt_cred.telethon_api_id == 0 or self.opt_cred.telethon_api_hash == "":
|
|
86
|
-
self.guide()
|
|
87
|
-
cred_valid = self.get_api_info()
|
|
88
|
-
if cred_valid:
|
|
89
|
-
return self.signin()
|
|
90
|
-
else:
|
|
91
|
-
return False, None, 0, ""
|
|
92
|
-
|
|
93
|
-
async def start_async(self) -> Tuple[bool, Optional[TelegramClient], int, str]:
|
|
94
|
-
if self.opt_cred.telethon_api_id == 0 or self.opt_cred.telethon_api_hash == "":
|
|
95
|
-
self.guide()
|
|
96
|
-
self.get_api_info()
|
|
97
|
-
return await self.signin_async()
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
from typing import Any, Dict, Protocol
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class SingletonProtocol(Protocol):
|
|
6
|
-
def close(self) -> Any: ...
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class Singletons:
|
|
10
|
-
def __init__(self) -> None:
|
|
11
|
-
self.objs: Dict[str, SingletonProtocol] = {}
|
|
12
|
-
|
|
13
|
-
def close(self) -> None:
|
|
14
|
-
for obj in self.objs.values():
|
|
15
|
-
obj.close()
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
singletons = Singletons()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|