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,177 +1,186 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
import copy
|
|
3
|
-
import zipfile
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
from typing import Any, List, Tuple
|
|
6
|
-
|
|
7
|
-
from sticker_convert.converter import StickerConvert
|
|
8
|
-
from sticker_convert.job_option import CompOption, CredOption, OutputOption
|
|
9
|
-
from sticker_convert.uploaders.upload_base import UploadBase
|
|
10
|
-
from sticker_convert.utils.callback import CallbackProtocol, CallbackReturn
|
|
11
|
-
from sticker_convert.utils.files.metadata_handler import MetadataHandler
|
|
12
|
-
from sticker_convert.utils.files.sanitize_filename import sanitize_filename
|
|
13
|
-
from sticker_convert.utils.media.codec_info import CodecInfo
|
|
14
|
-
from sticker_convert.utils.media.format_verify import FormatVerify
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
self.base_spec.
|
|
22
|
-
self.base_spec.
|
|
23
|
-
self.base_spec.
|
|
24
|
-
self.base_spec.
|
|
25
|
-
self.base_spec.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
self.spec_cover.set_res(96)
|
|
34
|
-
self.spec_cover.
|
|
35
|
-
self.spec_cover.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
self.webp_spec.
|
|
39
|
-
self.webp_spec.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
self.png_spec.
|
|
43
|
-
self.png_spec.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
self.opt_comp_merged.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
cover_opt_comp_merged.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
self.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
self.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import copy
|
|
3
|
+
import zipfile
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Any, List, Tuple
|
|
6
|
+
|
|
7
|
+
from sticker_convert.converter import StickerConvert
|
|
8
|
+
from sticker_convert.job_option import CompOption, CredOption, OutputOption
|
|
9
|
+
from sticker_convert.uploaders.upload_base import UploadBase
|
|
10
|
+
from sticker_convert.utils.callback import CallbackProtocol, CallbackReturn
|
|
11
|
+
from sticker_convert.utils.files.metadata_handler import MetadataHandler
|
|
12
|
+
from sticker_convert.utils.files.sanitize_filename import sanitize_filename
|
|
13
|
+
from sticker_convert.utils.media.codec_info import CodecInfo
|
|
14
|
+
from sticker_convert.utils.media.format_verify import FormatVerify
|
|
15
|
+
from sticker_convert.utils.translate import I
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class CompressWastickers(UploadBase):
|
|
19
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
20
|
+
super().__init__(*args, **kwargs)
|
|
21
|
+
self.base_spec.size_max_img = 100000
|
|
22
|
+
self.base_spec.size_max_vid = 500000
|
|
23
|
+
self.base_spec.duration_min = 8
|
|
24
|
+
self.base_spec.duration_max = 10000
|
|
25
|
+
self.base_spec.set_res(512)
|
|
26
|
+
self.base_spec.set_format((".webp",))
|
|
27
|
+
|
|
28
|
+
self.spec_cover = CompOption(
|
|
29
|
+
size_max_img=50000,
|
|
30
|
+
size_max_vid=50000,
|
|
31
|
+
animated=False,
|
|
32
|
+
)
|
|
33
|
+
self.spec_cover.set_res(96)
|
|
34
|
+
self.spec_cover.set_res(96)
|
|
35
|
+
self.spec_cover.set_fps(0)
|
|
36
|
+
self.spec_cover.set_format((".png",))
|
|
37
|
+
|
|
38
|
+
self.webp_spec = copy.deepcopy(self.base_spec)
|
|
39
|
+
self.webp_spec.set_format((".webp",))
|
|
40
|
+
self.webp_spec.animated = None if self.opt_comp.fake_vid else True
|
|
41
|
+
|
|
42
|
+
self.png_spec = copy.deepcopy(self.base_spec)
|
|
43
|
+
self.png_spec.set_format((".png",))
|
|
44
|
+
self.png_spec.animated = False
|
|
45
|
+
|
|
46
|
+
self.opt_comp_merged = copy.deepcopy(self.opt_comp)
|
|
47
|
+
self.opt_comp_merged.merge(self.base_spec)
|
|
48
|
+
|
|
49
|
+
def compress_wastickers(self) -> Tuple[int, int, List[str]]:
|
|
50
|
+
urls: List[str] = []
|
|
51
|
+
title, author, _ = MetadataHandler.get_metadata(
|
|
52
|
+
self.opt_output.dir,
|
|
53
|
+
title=self.opt_output.title,
|
|
54
|
+
author=self.opt_output.author,
|
|
55
|
+
)
|
|
56
|
+
if not title:
|
|
57
|
+
self.cb.put(I("Title is required for compressing .wastickers"))
|
|
58
|
+
return 0, 0, urls
|
|
59
|
+
if not author:
|
|
60
|
+
self.cb.put(I("Author is required for compressing .wastickers"))
|
|
61
|
+
return 0, 0, urls
|
|
62
|
+
packs = MetadataHandler.split_sticker_packs(
|
|
63
|
+
self.opt_output.dir,
|
|
64
|
+
title=title,
|
|
65
|
+
file_per_pack=30,
|
|
66
|
+
separate_image_anim=not self.opt_comp.fake_vid,
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
stickers_total = 0
|
|
70
|
+
for pack_title, stickers in packs.items():
|
|
71
|
+
stickers_total += len(stickers)
|
|
72
|
+
out_f = Path(
|
|
73
|
+
self.opt_output.dir, sanitize_filename(pack_title + ".wastickers")
|
|
74
|
+
).as_posix()
|
|
75
|
+
|
|
76
|
+
MetadataHandler.set_metadata(
|
|
77
|
+
self.opt_output.dir, author=author, title=title, newline=True
|
|
78
|
+
)
|
|
79
|
+
with zipfile.ZipFile(out_f, "w", zipfile.ZIP_DEFLATED) as zipf:
|
|
80
|
+
cover_opt_comp_merged = copy.deepcopy(self.opt_comp)
|
|
81
|
+
cover_opt_comp_merged.merge(self.spec_cover)
|
|
82
|
+
|
|
83
|
+
cover_path_old = MetadataHandler.get_cover(self.opt_output.dir)
|
|
84
|
+
cover_path_new = Path("bytes.png")
|
|
85
|
+
if cover_path_old is None:
|
|
86
|
+
# First image in the directory, extracting first frame
|
|
87
|
+
first_image = [
|
|
88
|
+
i
|
|
89
|
+
for i in sorted(self.opt_output.dir.iterdir())
|
|
90
|
+
if Path(self.opt_output.dir, i.name).is_file()
|
|
91
|
+
and i.suffix not in (".txt", ".m4a", ".wastickers")
|
|
92
|
+
][0]
|
|
93
|
+
self.cb.put(I("Creating cover using {}").format(first_image.name))
|
|
94
|
+
success, _, cover_data, _ = StickerConvert.convert(
|
|
95
|
+
Path(self.opt_output.dir, first_image),
|
|
96
|
+
cover_path_new,
|
|
97
|
+
cover_opt_comp_merged,
|
|
98
|
+
self.cb,
|
|
99
|
+
self.cb_return,
|
|
100
|
+
)
|
|
101
|
+
if not success:
|
|
102
|
+
self.cb.put(
|
|
103
|
+
I(
|
|
104
|
+
"Warning: Cannot compress cover {}, unable to create .wastickers"
|
|
105
|
+
).format(first_image.name)
|
|
106
|
+
)
|
|
107
|
+
continue
|
|
108
|
+
else:
|
|
109
|
+
if not FormatVerify.check_file(
|
|
110
|
+
cover_path_old, spec=self.spec_cover
|
|
111
|
+
):
|
|
112
|
+
success, _, cover_data, _ = StickerConvert.convert(
|
|
113
|
+
cover_path_old,
|
|
114
|
+
cover_path_new,
|
|
115
|
+
cover_opt_comp_merged,
|
|
116
|
+
self.cb,
|
|
117
|
+
self.cb_return,
|
|
118
|
+
)
|
|
119
|
+
if not success:
|
|
120
|
+
self.cb.put(
|
|
121
|
+
I(
|
|
122
|
+
"Warning: Cannot compress cover {}, unable to create .wastickers"
|
|
123
|
+
).format(cover_path_old.name)
|
|
124
|
+
)
|
|
125
|
+
continue
|
|
126
|
+
else:
|
|
127
|
+
with open(cover_path_old, "rb") as f:
|
|
128
|
+
cover_data = f.read()
|
|
129
|
+
|
|
130
|
+
assert isinstance(cover_data, bytes)
|
|
131
|
+
zipf.writestr("tray.png", cover_data)
|
|
132
|
+
zipf.write(Path(self.opt_output.dir, "author.txt"), "author.txt")
|
|
133
|
+
zipf.write(Path(self.opt_output.dir, "title.txt"), "title.txt")
|
|
134
|
+
|
|
135
|
+
for num, src in enumerate(stickers):
|
|
136
|
+
self.cb.put(
|
|
137
|
+
I("Verifying {} for compressing into .wastickers").format(src)
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
if self.opt_comp.fake_vid or CodecInfo.is_anim(src):
|
|
141
|
+
ext = ".webp"
|
|
142
|
+
else:
|
|
143
|
+
ext = ".png"
|
|
144
|
+
dst = f"bytes{ext}"
|
|
145
|
+
|
|
146
|
+
if not (
|
|
147
|
+
FormatVerify.check_file(src, spec=self.webp_spec)
|
|
148
|
+
or FormatVerify.check_file(src, spec=self.png_spec)
|
|
149
|
+
):
|
|
150
|
+
success, _, image_data, _ = StickerConvert.convert(
|
|
151
|
+
Path(src),
|
|
152
|
+
Path(dst),
|
|
153
|
+
self.opt_comp_merged,
|
|
154
|
+
self.cb,
|
|
155
|
+
self.cb_return,
|
|
156
|
+
)
|
|
157
|
+
assert isinstance(image_data, bytes)
|
|
158
|
+
if not success:
|
|
159
|
+
self.cb.put(
|
|
160
|
+
I(
|
|
161
|
+
"Warning: Cannot compress file {}, skip this file..."
|
|
162
|
+
).format(Path(src).name)
|
|
163
|
+
)
|
|
164
|
+
continue
|
|
165
|
+
else:
|
|
166
|
+
with open(src, "rb") as f:
|
|
167
|
+
image_data = f.read()
|
|
168
|
+
|
|
169
|
+
# Originally the Sticker Maker application name the files with int(time.time())
|
|
170
|
+
zipf.writestr(f"sticker_{num + 1}{ext}", image_data)
|
|
171
|
+
|
|
172
|
+
self.cb.put((out_f))
|
|
173
|
+
urls.append(out_f)
|
|
174
|
+
|
|
175
|
+
return stickers_total, stickers_total, urls
|
|
176
|
+
|
|
177
|
+
@staticmethod
|
|
178
|
+
def start(
|
|
179
|
+
opt_output: OutputOption,
|
|
180
|
+
opt_comp: CompOption,
|
|
181
|
+
opt_cred: CredOption,
|
|
182
|
+
cb: CallbackProtocol,
|
|
183
|
+
cb_return: CallbackReturn,
|
|
184
|
+
) -> Tuple[int, int, List[str]]:
|
|
185
|
+
exporter = CompressWastickers(opt_output, opt_comp, opt_cred, cb, cb_return)
|
|
186
|
+
return exporter.compress_wastickers()
|
|
@@ -1,35 +1,44 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
from sticker_convert.
|
|
4
|
-
from sticker_convert.utils.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
self
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
from sticker_convert.job_option import CompOption, CredOption, OutputOption
|
|
3
|
+
from sticker_convert.utils.callback import CallbackProtocol, CallbackReturn
|
|
4
|
+
from sticker_convert.utils.translate import I
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def get_msg_emoji_txt_required():
|
|
8
|
+
return I(
|
|
9
|
+
"emoji.txt is required for uploading signal stickers\n"
|
|
10
|
+
"emoji.txt generated for you in {}\n"
|
|
11
|
+
"Default emoji is set to {}.\n"
|
|
12
|
+
"Please edit emoji.txt now, then continue"
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class UploadBase:
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
opt_output: OutputOption,
|
|
20
|
+
opt_comp: CompOption,
|
|
21
|
+
opt_cred: CredOption,
|
|
22
|
+
cb: CallbackProtocol,
|
|
23
|
+
cb_return: CallbackReturn,
|
|
24
|
+
) -> None:
|
|
25
|
+
self.opt_output = opt_output
|
|
26
|
+
self.opt_comp = opt_comp
|
|
27
|
+
self.opt_cred = opt_cred
|
|
28
|
+
self.cb = cb
|
|
29
|
+
self.cb_return = cb_return
|
|
30
|
+
|
|
31
|
+
self.base_spec = CompOption(
|
|
32
|
+
fps_power=self.opt_comp.fps_power,
|
|
33
|
+
res_power=self.opt_comp.res_power,
|
|
34
|
+
quality_min=self.opt_comp.quality_min,
|
|
35
|
+
quality_max=self.opt_comp.quality_max,
|
|
36
|
+
quality_power=self.opt_comp.quality_power,
|
|
37
|
+
color_min=self.opt_comp.color_min,
|
|
38
|
+
color_max=self.opt_comp.color_max,
|
|
39
|
+
color_power=self.opt_comp.color_power,
|
|
40
|
+
quantize_method=self.opt_comp.quantize_method,
|
|
41
|
+
scale_filter=self.opt_comp.scale_filter,
|
|
42
|
+
steps=self.opt_comp.steps,
|
|
43
|
+
cache_dir=self.opt_comp.cache_dir,
|
|
44
|
+
)
|