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.
Files changed (93) hide show
  1. sticker_convert/__main__.py +24 -27
  2. sticker_convert/auth/__init__.py +0 -0
  3. sticker_convert/auth/auth_base.py +19 -0
  4. sticker_convert/{utils/auth/get_discord_auth.py → auth/auth_discord.py} +149 -118
  5. sticker_convert/{utils/auth/get_kakao_auth.py → auth/auth_kakao_android_login.py} +331 -330
  6. sticker_convert/auth/auth_kakao_desktop_login.py +327 -0
  7. sticker_convert/{utils/auth/get_kakao_desktop_auth.py → auth/auth_kakao_desktop_memdump.py} +281 -263
  8. sticker_convert/{utils/auth/get_line_auth.py → auth/auth_line.py} +98 -80
  9. sticker_convert/{utils/auth/get_signal_auth.py → auth/auth_signal.py} +139 -135
  10. sticker_convert/auth/auth_telethon.py +161 -0
  11. sticker_convert/{utils/auth/get_viber_auth.py → auth/auth_viber.py} +250 -235
  12. sticker_convert/{utils/auth → auth}/telegram_api.py +736 -675
  13. sticker_convert/cli.py +623 -608
  14. sticker_convert/converter.py +1093 -1084
  15. sticker_convert/definitions.py +4 -0
  16. sticker_convert/downloaders/download_band.py +111 -110
  17. sticker_convert/downloaders/download_base.py +171 -166
  18. sticker_convert/downloaders/download_discord.py +92 -91
  19. sticker_convert/downloaders/download_kakao.py +417 -404
  20. sticker_convert/downloaders/download_line.py +484 -475
  21. sticker_convert/downloaders/download_ogq.py +80 -79
  22. sticker_convert/downloaders/download_signal.py +108 -105
  23. sticker_convert/downloaders/download_telegram.py +56 -55
  24. sticker_convert/downloaders/download_viber.py +121 -120
  25. sticker_convert/gui.py +788 -873
  26. sticker_convert/gui_components/frames/comp_frame.py +180 -166
  27. sticker_convert/gui_components/frames/config_frame.py +156 -113
  28. sticker_convert/gui_components/frames/control_frame.py +32 -30
  29. sticker_convert/gui_components/frames/cred_frame.py +232 -233
  30. sticker_convert/gui_components/frames/input_frame.py +139 -137
  31. sticker_convert/gui_components/frames/output_frame.py +112 -110
  32. sticker_convert/gui_components/frames/right_clicker.py +25 -23
  33. sticker_convert/gui_components/windows/advanced_compression_window.py +757 -757
  34. sticker_convert/gui_components/windows/base_window.py +7 -2
  35. sticker_convert/gui_components/windows/discord_get_auth_window.py +79 -82
  36. sticker_convert/gui_components/windows/kakao_get_auth_window.py +511 -321
  37. sticker_convert/gui_components/windows/line_get_auth_window.py +94 -102
  38. sticker_convert/gui_components/windows/signal_get_auth_window.py +84 -89
  39. sticker_convert/gui_components/windows/viber_get_auth_window.py +168 -168
  40. sticker_convert/ios-message-stickers-template/.github/FUNDING.yml +3 -3
  41. sticker_convert/ios-message-stickers-template/README.md +10 -10
  42. sticker_convert/ios-message-stickers-template/stickers/Info.plist +43 -43
  43. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Info.plist +31 -31
  44. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Contents.json +6 -6
  45. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Contents.json +20 -20
  46. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 1.sticker/Contents.json +9 -9
  47. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 2.sticker/Contents.json +9 -9
  48. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 3.sticker/Contents.json +9 -9
  49. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Contents.json +91 -91
  50. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.pbxproj +364 -364
  51. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -7
  52. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  53. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/xcuserdata/niklaspeterson.xcuserdatad/xcschemes/xcschememanagement.plist +14 -14
  54. sticker_convert/job.py +166 -130
  55. sticker_convert/job_option.py +1 -0
  56. sticker_convert/locales/en_US/LC_MESSAGES/base.mo +0 -0
  57. sticker_convert/locales/ja_JP/LC_MESSAGES/base.mo +0 -0
  58. sticker_convert/locales/zh_CN/LC_MESSAGES/base.mo +0 -0
  59. sticker_convert/locales/zh_TW/LC_MESSAGES/base.mo +0 -0
  60. sticker_convert/py.typed +0 -0
  61. sticker_convert/resources/NotoColorEmoji.ttf +0 -0
  62. sticker_convert/resources/help.ja_JP.json +88 -0
  63. sticker_convert/resources/help.json +10 -7
  64. sticker_convert/resources/help.zh_CN.json +88 -0
  65. sticker_convert/resources/help.zh_TW.json +88 -0
  66. sticker_convert/resources/input.ja_JP.json +74 -0
  67. sticker_convert/resources/input.json +121 -121
  68. sticker_convert/resources/input.zh_CN.json +74 -0
  69. sticker_convert/resources/input.zh_TW.json +74 -0
  70. sticker_convert/resources/output.ja_JP.json +38 -0
  71. sticker_convert/resources/output.zh_CN.json +38 -0
  72. sticker_convert/resources/output.zh_TW.json +38 -0
  73. sticker_convert/uploaders/compress_wastickers.py +186 -177
  74. sticker_convert/uploaders/upload_base.py +44 -35
  75. sticker_convert/uploaders/upload_signal.py +218 -203
  76. sticker_convert/uploaders/upload_telegram.py +353 -338
  77. sticker_convert/uploaders/upload_viber.py +178 -169
  78. sticker_convert/uploaders/xcode_imessage.py +295 -286
  79. sticker_convert/utils/callback.py +238 -6
  80. sticker_convert/utils/emoji.py +16 -4
  81. sticker_convert/utils/files/json_resources_loader.py +24 -19
  82. sticker_convert/utils/files/metadata_handler.py +3 -3
  83. sticker_convert/utils/translate.py +108 -0
  84. sticker_convert/utils/url_detect.py +40 -37
  85. sticker_convert/version.py +1 -1
  86. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/METADATA +89 -74
  87. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/RECORD +91 -74
  88. sticker_convert/utils/auth/telethon_setup.py +0 -97
  89. sticker_convert/utils/singletons.py +0 -18
  90. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/WHEEL +0 -0
  91. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/entry_points.txt +0 -0
  92. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/licenses/LICENSE +0 -0
  93. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/top_level.txt +0 -0
@@ -1,30 +1,32 @@
1
- #!/usr/bin/env python3
2
- from typing import TYPE_CHECKING, Any
3
-
4
- from ttkbootstrap import Button, Frame # type: ignore
5
-
6
- if TYPE_CHECKING:
7
- from sticker_convert.gui import GUI
8
-
9
-
10
- class ControlFrame(Frame):
11
- def __init__(self, gui: "GUI", *args: Any, **kwargs: Any) -> None:
12
- self.gui = gui
13
- super().__init__(*args, **kwargs)
14
-
15
- self.start_btn = Button(
16
- self,
17
- text="Start",
18
- command=self.cb_start_btn,
19
- bootstyle="default", # type: ignore
20
- )
21
-
22
- self.start_btn.pack(expand=True, fill="x")
23
-
24
- def cb_start_btn(self, *args: Any, **kwargs: Any) -> None:
25
- if self.gui.job:
26
- response = self.gui.cb_ask_bool("Cancel job?")
27
- if response is True:
28
- self.gui.cancel_job()
29
- else:
30
- self.gui.start_job()
1
+ #!/usr/bin/env python3
2
+ from typing import TYPE_CHECKING, Any
3
+
4
+ from ttkbootstrap import Button, Frame # type: ignore
5
+
6
+ from sticker_convert.utils.translate import I
7
+
8
+ if TYPE_CHECKING:
9
+ from sticker_convert.gui import GUI
10
+
11
+
12
+ class ControlFrame(Frame):
13
+ def __init__(self, gui: "GUI", *args: Any, **kwargs: Any) -> None:
14
+ self.gui = gui
15
+ super().__init__(*args, **kwargs)
16
+
17
+ self.start_btn = Button(
18
+ self,
19
+ text=I("Start"),
20
+ command=self.cb_start_btn,
21
+ bootstyle="default", # type: ignore
22
+ )
23
+
24
+ self.start_btn.pack(expand=True, fill="x")
25
+
26
+ def cb_start_btn(self, *args: Any, **kwargs: Any) -> None:
27
+ if self.gui.job:
28
+ response = self.gui.cb.ask_bool(I("Cancel job?"))
29
+ if response is True:
30
+ self.gui.cancel_job()
31
+ else:
32
+ self.gui.start_job()
@@ -1,233 +1,232 @@
1
- #!/usr/bin/env python3
2
- import webbrowser
3
- from typing import TYPE_CHECKING, Any
4
-
5
- from ttkbootstrap import Button, Entry, Label, LabelFrame # type: ignore
6
-
7
- from sticker_convert.gui_components.frames.right_clicker import RightClicker
8
- from sticker_convert.gui_components.windows.discord_get_auth_window import DiscordGetAuthWindow
9
- from sticker_convert.gui_components.windows.kakao_get_auth_window import KakaoGetAuthWindow
10
- from sticker_convert.gui_components.windows.line_get_auth_window import LineGetAuthWindow
11
- from sticker_convert.gui_components.windows.signal_get_auth_window import SignalGetAuthWindow
12
- from sticker_convert.gui_components.windows.viber_get_auth_window import ViberGetAuthWindow
13
- from sticker_convert.utils.auth.telethon_setup import TelethonSetup
14
-
15
- if TYPE_CHECKING:
16
- from sticker_convert.gui import GUI # type: ignore
17
-
18
-
19
- class CredFrame(LabelFrame):
20
- def __init__(self, gui: "GUI", *args: Any, **kwargs: Any) -> None:
21
- self.gui = gui
22
- super().__init__(*args, **kwargs)
23
-
24
- self.grid_columnconfigure(1, weight=1)
25
-
26
- self.signal_uuid_lbl = Label(
27
- self, text="Signal uuid", width=18, justify="left", anchor="w"
28
- )
29
- self.signal_uuid_entry = Entry(
30
- self,
31
- textvariable=self.gui.signal_uuid_var,
32
- width=50,
33
- validate="focusout",
34
- validatecommand=self.gui.highlight_fields,
35
- )
36
- self.signal_uuid_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
37
-
38
- self.signal_password_lbl = Label(
39
- self, text="Signal password", justify="left", anchor="w"
40
- )
41
- self.signal_password_entry = Entry(
42
- self,
43
- textvariable=self.gui.signal_password_var,
44
- width=50,
45
- validate="focusout",
46
- validatecommand=self.gui.highlight_fields,
47
- )
48
- self.signal_password_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
49
-
50
- self.signal_get_auth_btn = Button(
51
- self,
52
- text="Generate",
53
- command=self.cb_signal_get_auth,
54
- bootstyle="secondary", # type: ignore
55
- )
56
-
57
- self.telegram_token_lbl = Label(
58
- self, text="Telegram token", justify="left", anchor="w"
59
- )
60
- self.telegram_token_entry = Entry(
61
- self,
62
- textvariable=self.gui.telegram_token_var,
63
- width=50,
64
- validate="focusout",
65
- validatecommand=self.gui.highlight_fields,
66
- )
67
- self.telegram_token_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
68
-
69
- self.telegram_userid_lbl = Label(
70
- self, text="Telegram user_id", justify="left", anchor="w"
71
- )
72
- self.telegram_userid_entry = Entry(
73
- self,
74
- textvariable=self.gui.telegram_userid_var,
75
- width=50,
76
- validate="focusout",
77
- validatecommand=self.gui.highlight_fields,
78
- )
79
- self.telegram_userid_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
80
-
81
- self.telethon_auth_lbl = Label(
82
- self, text="Telethon authorization", justify="left", anchor="w"
83
- )
84
- self.telethon_auth_btn = Button(
85
- self,
86
- text="Generate",
87
- command=self.cb_telethon_get_auth,
88
- bootstyle="secondary", # type: ignore
89
- )
90
-
91
- self.kakao_auth_token_lbl = Label(
92
- self, text="Kakao auth_token", justify="left", anchor="w"
93
- )
94
- self.kakao_auth_token_entry = Entry(
95
- self, textvariable=self.gui.kakao_auth_token_var, width=35
96
- )
97
- self.kakao_auth_token_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
98
- self.kakao_get_auth_btn = Button(
99
- self,
100
- text="Generate",
101
- command=self.cb_kakao_get_auth,
102
- bootstyle="secondary", # type: ignore
103
- )
104
-
105
- self.line_cookies_lbl = Label(
106
- self, text="Line cookies", width=18, justify="left", anchor="w"
107
- )
108
- self.line_cookies_entry = Entry(
109
- self, textvariable=self.gui.line_cookies_var, width=35
110
- )
111
- self.line_cookies_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
112
- self.line_get_auth_btn = Button(
113
- self,
114
- text="Generate",
115
- command=self.cb_line_get_auth,
116
- bootstyle="secondary", # type: ignore
117
- )
118
-
119
- self.viber_auth_lbl = Label(
120
- self, text="Viber auth", width=18, justify="left", anchor="w"
121
- )
122
- self.viber_auth_entry = Entry(
123
- self, textvariable=self.gui.viber_auth_var, width=35
124
- )
125
- self.viber_auth_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
126
- self.viber_get_auth_btn = Button(
127
- self,
128
- text="Generate",
129
- command=self.cb_viber_get_auth,
130
- bootstyle="secondary", # type: ignore
131
- )
132
-
133
- self.discord_token_lbl = Label(
134
- self, text="Discord token", width=18, justify="left", anchor="w"
135
- )
136
- self.discord_token_entry = Entry(
137
- self, textvariable=self.gui.discord_token_var, width=35
138
- )
139
- self.discord_token_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
140
- self.discord_get_auth_btn = Button(
141
- self,
142
- text="Generate",
143
- command=self.cb_discord_get_auth,
144
- bootstyle="secondary", # type: ignore
145
- )
146
-
147
- self.help_btn = Button(
148
- self,
149
- text="Get help",
150
- command=self.cb_cred_help,
151
- bootstyle="secondary", # type: ignore
152
- )
153
-
154
- self.signal_uuid_lbl.grid(column=0, row=0, sticky="w", padx=3, pady=3)
155
- self.signal_uuid_entry.grid(
156
- column=1, row=0, columnspan=2, sticky="w", padx=3, pady=3
157
- )
158
- self.signal_password_lbl.grid(column=0, row=1, sticky="w", padx=3, pady=3)
159
- self.signal_password_entry.grid(
160
- column=1, row=1, columnspan=2, sticky="w", padx=3, pady=3
161
- )
162
- self.signal_get_auth_btn.grid(column=2, row=2, sticky="e", padx=3, pady=3)
163
- self.telegram_token_lbl.grid(column=0, row=3, sticky="w", padx=3, pady=3)
164
- self.telegram_token_entry.grid(
165
- column=1, row=3, columnspan=2, sticky="w", padx=3, pady=3
166
- )
167
- self.telegram_userid_lbl.grid(column=0, row=4, sticky="w", padx=3, pady=3)
168
- self.telegram_userid_entry.grid(
169
- column=1, row=4, columnspan=2, sticky="w", padx=3, pady=3
170
- )
171
- self.telethon_auth_lbl.grid(column=0, row=5, sticky="w", padx=3, pady=3)
172
- self.telethon_auth_btn.grid(column=2, row=5, sticky="e", padx=3, pady=3)
173
- self.kakao_auth_token_lbl.grid(column=0, row=6, sticky="w", padx=3, pady=3)
174
- self.kakao_auth_token_entry.grid(column=1, row=6, sticky="w", padx=3, pady=3)
175
- self.kakao_get_auth_btn.grid(column=2, row=6, sticky="e", padx=3, pady=3)
176
- self.line_cookies_lbl.grid(column=0, row=7, sticky="w", padx=3, pady=3)
177
- self.line_cookies_entry.grid(column=1, row=7, sticky="w", padx=3, pady=3)
178
- self.line_get_auth_btn.grid(column=2, row=7, sticky="e", padx=3, pady=3)
179
- self.viber_auth_lbl.grid(column=0, row=8, sticky="w", padx=3, pady=3)
180
- self.viber_auth_entry.grid(column=1, row=8, sticky="w", padx=3, pady=3)
181
- self.viber_get_auth_btn.grid(column=2, row=8, sticky="e", padx=3, pady=3)
182
- self.discord_token_lbl.grid(column=0, row=9, sticky="w", padx=3, pady=3)
183
- self.discord_token_entry.grid(column=1, row=9, sticky="w", padx=3, pady=3)
184
- self.discord_get_auth_btn.grid(column=2, row=9, sticky="e", padx=3, pady=3)
185
- self.help_btn.grid(column=2, row=10, sticky="e", padx=3, pady=3)
186
-
187
- def cb_cred_help(self, *_: Any) -> None:
188
- faq_site = "https://github.com/laggykiller/sticker-convert#faq"
189
- success = webbrowser.open(faq_site)
190
- if not success:
191
- self.gui.cb_ask_str("You can get help from:", initialvalue=faq_site)
192
-
193
- def cb_telethon_get_auth(self, *_: Any) -> None:
194
- success, _client, api_id, api_hash = TelethonSetup(
195
- self.gui.get_opt_cred(), self.gui.cb_ask_str
196
- ).start()
197
- if success:
198
- self.gui.telethon_api_id_var.set(api_id)
199
- self.gui.telethon_api_hash_var.set(api_hash)
200
- self.gui.save_creds()
201
- self.gui.cb_msg_block("Telethon setup successful")
202
- else:
203
- self.gui.cb_msg_block("Telethon setup failed")
204
-
205
- def cb_kakao_get_auth(self, *_: Any) -> None:
206
- KakaoGetAuthWindow(self.gui)
207
-
208
- def cb_signal_get_auth(self, *_: Any) -> None:
209
- SignalGetAuthWindow(self.gui)
210
-
211
- def cb_line_get_auth(self, *_: Any) -> None:
212
- LineGetAuthWindow(self.gui)
213
-
214
- def cb_viber_get_auth(self, *_: Any) -> None:
215
- ViberGetAuthWindow(self.gui)
216
-
217
- def cb_discord_get_auth(self, *_: Any) -> None:
218
- DiscordGetAuthWindow(self.gui)
219
-
220
- def set_states(self, state: str) -> None:
221
- self.signal_uuid_entry.config(state=state)
222
- self.signal_password_entry.config(state=state)
223
- self.signal_get_auth_btn.config(state=state)
224
- self.telegram_token_entry.config(state=state)
225
- self.telegram_userid_entry.config(state=state)
226
- self.kakao_auth_token_entry.config(state=state)
227
- self.kakao_get_auth_btn.config(state=state)
228
- self.line_cookies_entry.config(state=state)
229
- self.line_get_auth_btn.config(state=state)
230
- self.viber_auth_entry.config(state=state)
231
- self.viber_get_auth_btn.config(state=state)
232
- self.discord_token_entry.config(state=state)
233
- self.discord_get_auth_btn.config(state=state)
1
+ #!/usr/bin/env python3
2
+ import webbrowser
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from ttkbootstrap import Button, Entry, Label, LabelFrame # type: ignore
6
+
7
+ from sticker_convert.auth.auth_telethon import AuthTelethon
8
+ from sticker_convert.gui_components.frames.right_clicker import RightClicker
9
+ from sticker_convert.gui_components.windows.discord_get_auth_window import DiscordGetAuthWindow
10
+ from sticker_convert.gui_components.windows.kakao_get_auth_window import KakaoGetAuthWindow
11
+ from sticker_convert.gui_components.windows.line_get_auth_window import LineGetAuthWindow
12
+ from sticker_convert.gui_components.windows.signal_get_auth_window import SignalGetAuthWindow
13
+ from sticker_convert.gui_components.windows.viber_get_auth_window import ViberGetAuthWindow
14
+ from sticker_convert.utils.translate import I
15
+
16
+ if TYPE_CHECKING:
17
+ from sticker_convert.gui import GUI # type: ignore
18
+
19
+
20
+ class CredFrame(LabelFrame):
21
+ def __init__(self, gui: "GUI", *args: Any, **kwargs: Any) -> None:
22
+ self.gui = gui
23
+ super().__init__(*args, **kwargs)
24
+
25
+ self.grid_columnconfigure(1, weight=1)
26
+
27
+ self.signal_uuid_lbl = Label(
28
+ self, text=I("Signal uuid"), width=18, justify="left", anchor="w"
29
+ )
30
+ self.signal_uuid_entry = Entry(
31
+ self,
32
+ textvariable=self.gui.signal_uuid_var,
33
+ width=50,
34
+ validate="focusout",
35
+ validatecommand=self.gui.highlight_fields,
36
+ )
37
+ self.signal_uuid_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
38
+
39
+ self.signal_password_lbl = Label(
40
+ self, text=I("Signal password"), justify="left", anchor="w"
41
+ )
42
+ self.signal_password_entry = Entry(
43
+ self,
44
+ textvariable=self.gui.signal_password_var,
45
+ width=50,
46
+ validate="focusout",
47
+ validatecommand=self.gui.highlight_fields,
48
+ )
49
+ self.signal_password_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
50
+
51
+ self.signal_get_auth_btn = Button(
52
+ self,
53
+ text=I("Generate"),
54
+ command=self.cb_signal_get_auth,
55
+ bootstyle="secondary", # type: ignore
56
+ )
57
+
58
+ self.telegram_token_lbl = Label(
59
+ self, text=I("Telegram token"), justify="left", anchor="w"
60
+ )
61
+ self.telegram_token_entry = Entry(
62
+ self,
63
+ textvariable=self.gui.telegram_token_var,
64
+ width=50,
65
+ validate="focusout",
66
+ validatecommand=self.gui.highlight_fields,
67
+ )
68
+ self.telegram_token_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
69
+
70
+ self.telegram_userid_lbl = Label(
71
+ self, text=I("Telegram user_id"), justify="left", anchor="w"
72
+ )
73
+ self.telegram_userid_entry = Entry(
74
+ self,
75
+ textvariable=self.gui.telegram_userid_var,
76
+ width=50,
77
+ validate="focusout",
78
+ validatecommand=self.gui.highlight_fields,
79
+ )
80
+ self.telegram_userid_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
81
+
82
+ self.telethon_auth_lbl = Label(
83
+ self, text=I("Telethon authorization"), justify="left", anchor="w"
84
+ )
85
+ self.telethon_auth_btn = Button(
86
+ self,
87
+ text=I("Generate"),
88
+ command=self.cb_telethon_get_auth,
89
+ bootstyle="secondary", # type: ignore
90
+ )
91
+
92
+ self.kakao_auth_token_lbl = Label(
93
+ self, text=I("Kakao auth_token"), justify="left", anchor="w"
94
+ )
95
+ self.kakao_auth_token_entry = Entry(
96
+ self, textvariable=self.gui.kakao_auth_token_var, width=35
97
+ )
98
+ self.kakao_auth_token_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
99
+ self.kakao_get_auth_btn = Button(
100
+ self,
101
+ text=I("Generate"),
102
+ command=self.cb_kakao_get_auth,
103
+ bootstyle="secondary", # type: ignore
104
+ )
105
+
106
+ self.line_cookies_lbl = Label(
107
+ self, text=I("Line cookies"), width=18, justify="left", anchor="w"
108
+ )
109
+ self.line_cookies_entry = Entry(
110
+ self, textvariable=self.gui.line_cookies_var, width=35
111
+ )
112
+ self.line_cookies_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
113
+ self.line_get_auth_btn = Button(
114
+ self,
115
+ text=I("Generate"),
116
+ command=self.cb_line_get_auth,
117
+ bootstyle="secondary", # type: ignore
118
+ )
119
+
120
+ self.viber_auth_lbl = Label(
121
+ self, text=I("Viber auth"), width=18, justify="left", anchor="w"
122
+ )
123
+ self.viber_auth_entry = Entry(
124
+ self, textvariable=self.gui.viber_auth_var, width=35
125
+ )
126
+ self.viber_auth_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
127
+ self.viber_get_auth_btn = Button(
128
+ self,
129
+ text=I("Generate"),
130
+ command=self.cb_viber_get_auth,
131
+ bootstyle="secondary", # type: ignore
132
+ )
133
+
134
+ self.discord_token_lbl = Label(
135
+ self, text=I("Discord token"), width=18, justify="left", anchor="w"
136
+ )
137
+ self.discord_token_entry = Entry(
138
+ self, textvariable=self.gui.discord_token_var, width=35
139
+ )
140
+ self.discord_token_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
141
+ self.discord_get_auth_btn = Button(
142
+ self,
143
+ text=I("Generate"),
144
+ command=self.cb_discord_get_auth,
145
+ bootstyle="secondary", # type: ignore
146
+ )
147
+
148
+ self.help_btn = Button(
149
+ self,
150
+ text=I("Get help"),
151
+ command=self.cb_cred_help,
152
+ bootstyle="secondary", # type: ignore
153
+ )
154
+
155
+ self.signal_uuid_lbl.grid(column=0, row=0, sticky="w", padx=3, pady=3)
156
+ self.signal_uuid_entry.grid(
157
+ column=1, row=0, columnspan=2, sticky="w", padx=3, pady=3
158
+ )
159
+ self.signal_password_lbl.grid(column=0, row=1, sticky="w", padx=3, pady=3)
160
+ self.signal_password_entry.grid(
161
+ column=1, row=1, columnspan=2, sticky="w", padx=3, pady=3
162
+ )
163
+ self.signal_get_auth_btn.grid(column=2, row=2, sticky="e", padx=3, pady=3)
164
+ self.telegram_token_lbl.grid(column=0, row=3, sticky="w", padx=3, pady=3)
165
+ self.telegram_token_entry.grid(
166
+ column=1, row=3, columnspan=2, sticky="w", padx=3, pady=3
167
+ )
168
+ self.telegram_userid_lbl.grid(column=0, row=4, sticky="w", padx=3, pady=3)
169
+ self.telegram_userid_entry.grid(
170
+ column=1, row=4, columnspan=2, sticky="w", padx=3, pady=3
171
+ )
172
+ self.telethon_auth_lbl.grid(column=0, row=5, sticky="w", padx=3, pady=3)
173
+ self.telethon_auth_btn.grid(column=2, row=5, sticky="e", padx=3, pady=3)
174
+ self.kakao_auth_token_lbl.grid(column=0, row=6, sticky="w", padx=3, pady=3)
175
+ self.kakao_auth_token_entry.grid(column=1, row=6, sticky="w", padx=3, pady=3)
176
+ self.kakao_get_auth_btn.grid(column=2, row=6, sticky="e", padx=3, pady=3)
177
+ self.line_cookies_lbl.grid(column=0, row=7, sticky="w", padx=3, pady=3)
178
+ self.line_cookies_entry.grid(column=1, row=7, sticky="w", padx=3, pady=3)
179
+ self.line_get_auth_btn.grid(column=2, row=7, sticky="e", padx=3, pady=3)
180
+ self.viber_auth_lbl.grid(column=0, row=8, sticky="w", padx=3, pady=3)
181
+ self.viber_auth_entry.grid(column=1, row=8, sticky="w", padx=3, pady=3)
182
+ self.viber_get_auth_btn.grid(column=2, row=8, sticky="e", padx=3, pady=3)
183
+ self.discord_token_lbl.grid(column=0, row=9, sticky="w", padx=3, pady=3)
184
+ self.discord_token_entry.grid(column=1, row=9, sticky="w", padx=3, pady=3)
185
+ self.discord_get_auth_btn.grid(column=2, row=9, sticky="e", padx=3, pady=3)
186
+ self.help_btn.grid(column=2, row=10, sticky="e", padx=3, pady=3)
187
+
188
+ def cb_cred_help(self, *_: Any) -> None:
189
+ faq_site = "https://github.com/laggykiller/sticker-convert#faq"
190
+ success = webbrowser.open(faq_site)
191
+ if not success:
192
+ self.gui.cb.ask_str(I("You can get help from:"), initialvalue=faq_site)
193
+
194
+ def cb_telethon_get_auth(self, *_: Any) -> None:
195
+ success, _client, api_id, api_hash, msg = AuthTelethon(
196
+ self.gui.get_opt_cred(), self.gui.cb
197
+ ).start(check_auth_only=True)
198
+ if success:
199
+ self.gui.telethon_api_id_var.set(api_id)
200
+ self.gui.telethon_api_hash_var.set(api_hash)
201
+ self.gui.save_creds()
202
+ self.gui.cb.put(("msg_block", (msg,), None))
203
+
204
+ def cb_kakao_get_auth(self, *_: Any) -> None:
205
+ KakaoGetAuthWindow(self.gui)
206
+
207
+ def cb_signal_get_auth(self, *_: Any) -> None:
208
+ SignalGetAuthWindow(self.gui)
209
+
210
+ def cb_line_get_auth(self, *_: Any) -> None:
211
+ LineGetAuthWindow(self.gui)
212
+
213
+ def cb_viber_get_auth(self, *_: Any) -> None:
214
+ ViberGetAuthWindow(self.gui)
215
+
216
+ def cb_discord_get_auth(self, *_: Any) -> None:
217
+ DiscordGetAuthWindow(self.gui)
218
+
219
+ def set_states(self, state: str) -> None:
220
+ self.signal_uuid_entry.config(state=state)
221
+ self.signal_password_entry.config(state=state)
222
+ self.signal_get_auth_btn.config(state=state)
223
+ self.telegram_token_entry.config(state=state)
224
+ self.telegram_userid_entry.config(state=state)
225
+ self.kakao_auth_token_entry.config(state=state)
226
+ self.kakao_get_auth_btn.config(state=state)
227
+ self.line_cookies_entry.config(state=state)
228
+ self.line_get_auth_btn.config(state=state)
229
+ self.viber_auth_entry.config(state=state)
230
+ self.viber_get_auth_btn.config(state=state)
231
+ self.discord_token_entry.config(state=state)
232
+ self.discord_get_auth_btn.config(state=state)