easyrip 4.6.0__py3-none-any.whl → 4.7.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.
- easyrip/easyrip_log.py +1 -1
- easyrip/easyrip_main.py +1 -2
- easyrip/easyrip_mlang/lang_zh_Hans_CN.py +1 -1
- easyrip/global_val.py +1 -1
- easyrip/ripper/ripper.py +6 -2
- easyrip/ripper/sub_and_font/font.py +5 -5
- easyrip/utils.py +14 -14
- {easyrip-4.6.0.dist-info → easyrip-4.7.0.dist-info}/METADATA +1 -1
- {easyrip-4.6.0.dist-info → easyrip-4.7.0.dist-info}/RECORD +13 -13
- {easyrip-4.6.0.dist-info → easyrip-4.7.0.dist-info}/WHEEL +0 -0
- {easyrip-4.6.0.dist-info → easyrip-4.7.0.dist-info}/entry_points.txt +0 -0
- {easyrip-4.6.0.dist-info → easyrip-4.7.0.dist-info}/licenses/LICENSE +0 -0
- {easyrip-4.6.0.dist-info → easyrip-4.7.0.dist-info}/top_level.txt +0 -0
easyrip/easyrip_log.py
CHANGED
|
@@ -106,7 +106,7 @@ class log:
|
|
|
106
106
|
only_print = enum.auto()
|
|
107
107
|
only_write = enum.auto()
|
|
108
108
|
|
|
109
|
-
html_filename: str = "
|
|
109
|
+
html_filename: str = "EasyRip_log.html" # 在调用前覆写
|
|
110
110
|
print_level: LogLevel = LogLevel.send
|
|
111
111
|
write_level: LogLevel = LogLevel.send
|
|
112
112
|
|
easyrip/easyrip_main.py
CHANGED
|
@@ -662,7 +662,6 @@ def run_command(command: Iterable[str] | str) -> bool:
|
|
|
662
662
|
easyrip_web.run_server(*_params)
|
|
663
663
|
|
|
664
664
|
case Cmd_type.config:
|
|
665
|
-
log.debug(cmd_list)
|
|
666
665
|
match cmd_list[1]:
|
|
667
666
|
case "list" | "":
|
|
668
667
|
config.show_config_list()
|
|
@@ -1081,7 +1080,7 @@ def init(is_first_run: bool = False) -> None:
|
|
|
1081
1080
|
Global_lang_val.gettext_target_lang = Lang_tag.from_str(str(_lang_config))
|
|
1082
1081
|
|
|
1083
1082
|
# 设置日志文件路径名
|
|
1084
|
-
log.html_filename = gettext(
|
|
1083
|
+
log.html_filename = gettext(log.html_filename)
|
|
1085
1084
|
if _path := str(config.get_user_profile(Config_key.force_log_file_path) or ""):
|
|
1086
1085
|
log.html_filename = os.path.join(_path, log.html_filename)
|
|
1087
1086
|
|
|
@@ -308,7 +308,7 @@ LANG_MAP: dict[str, str] = {
|
|
|
308
308
|
"Current work directory has an other Easy Rip is running: {}": "当前工作目录存在其他 Easy Rip 正在运行: {}",
|
|
309
309
|
"Stop run command": "命令执行终止",
|
|
310
310
|
# log
|
|
311
|
-
"
|
|
311
|
+
"EasyRip_log.html": "EasyRip日志.html",
|
|
312
312
|
"Start": "开始",
|
|
313
313
|
"Input file pathname": "输入文件路径名",
|
|
314
314
|
"Output directory": "输出目录",
|
easyrip/global_val.py
CHANGED
|
@@ -3,7 +3,7 @@ import sys
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
|
|
5
5
|
PROJECT_NAME = "Easy Rip"
|
|
6
|
-
PROJECT_VERSION = "4.
|
|
6
|
+
PROJECT_VERSION = "4.7.0"
|
|
7
7
|
PROJECT_TITLE = f"{PROJECT_NAME} v{PROJECT_VERSION}"
|
|
8
8
|
PROJECT_URL = "https://github.com/op200/EasyRip"
|
|
9
9
|
PROJECT_RELEASE_API = "https://api.github.com/repos/op200/EasyRip/releases/latest"
|
easyrip/ripper/ripper.py
CHANGED
|
@@ -643,7 +643,9 @@ class Ripper:
|
|
|
643
643
|
_option_map = {
|
|
644
644
|
"crf": self.option_map.get("crf"),
|
|
645
645
|
"qp": self.option_map.get("qp"),
|
|
646
|
-
"pix_fmt": self.option_map.get(
|
|
646
|
+
"pix_fmt": self.option_map.get(
|
|
647
|
+
"pix_fmt", None if is_pipe_input else "yuv420p10le"
|
|
648
|
+
),
|
|
647
649
|
"preset:v": self.option_map.get("preset:v"),
|
|
648
650
|
"svtav1-params": self.option_map.get("svtav1-params"),
|
|
649
651
|
}
|
|
@@ -664,7 +666,9 @@ class Ripper:
|
|
|
664
666
|
case Ripper.Preset_name.vvenc:
|
|
665
667
|
_option_map = {
|
|
666
668
|
"qp": self.option_map.get("qp"),
|
|
667
|
-
"pix_fmt": self.option_map.get(
|
|
669
|
+
"pix_fmt": self.option_map.get(
|
|
670
|
+
"pix_fmt", None if is_pipe_input else "yuv420p10le"
|
|
671
|
+
),
|
|
668
672
|
"preset:v": self.option_map.get("preset:v"),
|
|
669
673
|
"vvenc-params": self.option_map.get("vvenc-params"),
|
|
670
674
|
}
|
|
@@ -55,7 +55,7 @@ def load_fonts(
|
|
|
55
55
|
for file in path.iterdir() if path.is_dir() else (path,):
|
|
56
56
|
if not (
|
|
57
57
|
file.is_file()
|
|
58
|
-
and (
|
|
58
|
+
and (suffix := file.suffix.lower()) in {".ttf", ".otf", ".ttc"}
|
|
59
59
|
):
|
|
60
60
|
continue
|
|
61
61
|
|
|
@@ -120,7 +120,7 @@ def load_fonts(
|
|
|
120
120
|
if is_regular:
|
|
121
121
|
if is_bold or is_italic:
|
|
122
122
|
log.error(
|
|
123
|
-
|
|
123
|
+
'Font "{}" is Regular but Bold={} and Italic={}. Skip this font',
|
|
124
124
|
file,
|
|
125
125
|
is_bold,
|
|
126
126
|
is_italic,
|
|
@@ -134,15 +134,15 @@ def load_fonts(
|
|
|
134
134
|
else:
|
|
135
135
|
res_font.font_type = Font_type.Regular
|
|
136
136
|
log.warning(
|
|
137
|
-
f
|
|
137
|
+
f'Font "{file}" does not have an English subfamily name. Defaulting to Regular'
|
|
138
138
|
)
|
|
139
139
|
|
|
140
140
|
res_font_list.append(res_font)
|
|
141
141
|
|
|
142
142
|
except TTLibError as e:
|
|
143
|
-
log.error(f'
|
|
143
|
+
log.error(f'Failed to load font file "{file}": {e}')
|
|
144
144
|
except Exception as e:
|
|
145
|
-
log.error(f
|
|
145
|
+
log.error(f'Unexpected error when load font "{file}": {e}')
|
|
146
146
|
|
|
147
147
|
return res_font_list
|
|
148
148
|
|
easyrip/utils.py
CHANGED
|
@@ -7,7 +7,7 @@ import sys
|
|
|
7
7
|
import time
|
|
8
8
|
from itertools import zip_longest
|
|
9
9
|
from pathlib import Path
|
|
10
|
-
from typing import Final, get_args, get_origin
|
|
10
|
+
from typing import Any, Final, TypeGuard, get_args, get_origin
|
|
11
11
|
|
|
12
12
|
from Crypto.Cipher import AES as CryptoAES
|
|
13
13
|
from Crypto.Util.Padding import pad, unpad
|
|
@@ -209,7 +209,7 @@ def non_ascii_str_len(s: str) -> int:
|
|
|
209
209
|
return sum(2 - int(ord(c) < 256) for c in s)
|
|
210
210
|
|
|
211
211
|
|
|
212
|
-
def type_match(val,
|
|
212
|
+
def type_match[T](val: Any, t: type[T]) -> TypeGuard[T]:
|
|
213
213
|
"""
|
|
214
214
|
检查值是否匹配给定的类型(支持泛型)
|
|
215
215
|
|
|
@@ -222,35 +222,35 @@ def type_match(val, b: type) -> bool:
|
|
|
222
222
|
|
|
223
223
|
Args:
|
|
224
224
|
val: 要检查的值
|
|
225
|
-
|
|
225
|
+
t: 目标类型,可以是普通类型或泛型
|
|
226
226
|
|
|
227
227
|
Returns:
|
|
228
228
|
bool: 值是否匹配目标类型
|
|
229
229
|
|
|
230
230
|
"""
|
|
231
|
-
|
|
231
|
+
t_org = get_origin(t)
|
|
232
232
|
|
|
233
233
|
# 如果不是泛型类型,直接使用 isinstance
|
|
234
|
-
if
|
|
235
|
-
return isinstance(val,
|
|
234
|
+
if t_org is None:
|
|
235
|
+
return isinstance(val, t)
|
|
236
236
|
|
|
237
237
|
# 首先检查是否是 b_org 的实例
|
|
238
|
-
if not isinstance(val,
|
|
238
|
+
if not isinstance(val, t_org):
|
|
239
239
|
return False
|
|
240
240
|
|
|
241
241
|
# 获取类型参数
|
|
242
|
-
args = get_args(
|
|
242
|
+
args = get_args(t)
|
|
243
243
|
if not args: # 没有类型参数,如 List
|
|
244
244
|
return True
|
|
245
245
|
|
|
246
246
|
# 根据不同的原始类型进行检查
|
|
247
|
-
if
|
|
247
|
+
if t_org is list:
|
|
248
248
|
# list[T] 检查
|
|
249
249
|
if len(args) == 1:
|
|
250
250
|
elem_type = args[0]
|
|
251
251
|
return all(type_match(item, elem_type) for item in val)
|
|
252
252
|
|
|
253
|
-
elif
|
|
253
|
+
elif t_org is tuple:
|
|
254
254
|
# tuple[T1, T2, ...] 或 tuple[T, ...] 检查
|
|
255
255
|
if len(args) == 2 and args[1] is ...: # 可变长度元组
|
|
256
256
|
elem_type = args[0]
|
|
@@ -260,7 +260,7 @@ def type_match(val, b: type) -> bool:
|
|
|
260
260
|
return False
|
|
261
261
|
return all(type_match(item, t) for item, t in zip(val, args, strict=False))
|
|
262
262
|
|
|
263
|
-
elif
|
|
263
|
+
elif t_org is dict:
|
|
264
264
|
# dict[K, V] 检查
|
|
265
265
|
if len(args) == 2:
|
|
266
266
|
key_type, value_type = args
|
|
@@ -269,19 +269,19 @@ def type_match(val, b: type) -> bool:
|
|
|
269
269
|
for k, v in val.items()
|
|
270
270
|
)
|
|
271
271
|
|
|
272
|
-
elif
|
|
272
|
+
elif t_org is set:
|
|
273
273
|
# set[T] 检查
|
|
274
274
|
if len(args) == 1:
|
|
275
275
|
elem_type = args[0]
|
|
276
276
|
return all(type_match(item, elem_type) for item in val)
|
|
277
277
|
|
|
278
|
-
elif
|
|
278
|
+
elif t_org is frozenset:
|
|
279
279
|
# frozenset[T] 检查
|
|
280
280
|
if len(args) == 1:
|
|
281
281
|
elem_type = args[0]
|
|
282
282
|
return all(type_match(item, elem_type) for item in val)
|
|
283
283
|
|
|
284
|
-
elif hasattr(
|
|
284
|
+
elif hasattr(t_org, "__name__") and t_org.__name__ == "Union":
|
|
285
285
|
# Union[T1, T2, ...] 或 T1 | T2 检查
|
|
286
286
|
return any(type_match(val, t) for t in args)
|
|
287
287
|
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
easyrip/__init__.py,sha256=PIvSPDgswsIkWL4dsCe87knnxKmtvcrWYzmqAwZix_M,765
|
|
2
2
|
easyrip/__main__.py,sha256=5t5NjuTSFW6jDp_HH4rTX8EOlf-GJI5HuTSwwndkw_I,4557
|
|
3
3
|
easyrip/easyrip_command.py,sha256=vuT9xg2OCuUXHH58BxcFGbzrzLUzlpynjGzjtDsBnCk,27837
|
|
4
|
-
easyrip/easyrip_log.py,sha256=
|
|
5
|
-
easyrip/easyrip_main.py,sha256=
|
|
4
|
+
easyrip/easyrip_log.py,sha256=i5r3OPGQ55c3_zCN0fmriPXiWxibq-w35FbNT7VfuuM,15610
|
|
5
|
+
easyrip/easyrip_main.py,sha256=0f1cU1ewC6gkuaP9O7vSRaSmFgKPo1KWmOIOKBZTOXw,43277
|
|
6
6
|
easyrip/easyrip_prompt.py,sha256=A5S7ybeJSGFkCmwdJ9TCQ_-lde7NWgkbFytZ2KnvkWI,2145
|
|
7
|
-
easyrip/global_val.py,sha256=
|
|
8
|
-
easyrip/utils.py,sha256=
|
|
7
|
+
easyrip/global_val.py,sha256=AniWAdkEWv8c1YUWspoNETpN2nhjRJh15QQOK5FaDXw,773
|
|
8
|
+
easyrip/utils.py,sha256=N1rMF1MyoC-YFBgy10_u29cFoowfhR-5Viea93O7wQ4,8750
|
|
9
9
|
easyrip/easyrip_config/config.py,sha256=aj6Vg1rJkvICSTZ0ZONznR_MkvVr5u5ngkX_zfZopvU,9859
|
|
10
10
|
easyrip/easyrip_config/config_key.py,sha256=_jjdKOunskUoG7UUWOz3QZK-s4LF_x6hmM9MKttyS2Q,766
|
|
11
11
|
easyrip/easyrip_mlang/__init__.py,sha256=QHZt4BYJFkJuaPkN89pt_zkM2grifJakyRZbeyfH8f4,1893
|
|
12
12
|
easyrip/easyrip_mlang/global_lang_val.py,sha256=Un20KGMVVMQbOaV_7VaHg3E1dvK2Y7kI1cPzq_sFWKY,9984
|
|
13
13
|
easyrip/easyrip_mlang/lang_en.py,sha256=heUSPeVtY1Nf9eDhrjPM28N3PLsu62op3llbXAfXvAs,140
|
|
14
|
-
easyrip/easyrip_mlang/lang_zh_Hans_CN.py,sha256=
|
|
14
|
+
easyrip/easyrip_mlang/lang_zh_Hans_CN.py,sha256=zJ9z5dW8yZdg6VWUMw3e7VNFjn_NoMhk9lK-PZLrPSo,18530
|
|
15
15
|
easyrip/easyrip_mlang/translator.py,sha256=Vg0S0p2rpMNAy3LHTdK7qKFdkPEXlOoCCXcaH7PyAC4,5939
|
|
16
16
|
easyrip/easyrip_web/__init__.py,sha256=tMyEeaSGeEJjND7MF0MBv9aDiDgaO3MOnppwxA70U2c,177
|
|
17
17
|
easyrip/easyrip_web/http_server.py,sha256=iyulCAFQrJlz86Lrr-Dm3fhOnNCf79Bp6fVHhr0ephY,8350
|
|
18
18
|
easyrip/easyrip_web/third_party_api.py,sha256=umj-QsfOa0IM60Ic2pXigVfnGfAiiC95fJSXQ-WFpJA,4419
|
|
19
19
|
easyrip/ripper/media_info.py,sha256=mQq_vbQ7S9fWpb39HLkoZlAL-pqNfwxewv6X776Nf50,5078
|
|
20
20
|
easyrip/ripper/param.py,sha256=x11G7AsU-1Ol37-psKNo8AtjKDdD8YPlXeNwJSbhZxw,11082
|
|
21
|
-
easyrip/ripper/ripper.py,sha256=
|
|
21
|
+
easyrip/ripper/ripper.py,sha256=k00oHGk9X3ciJ8KzHa_jaHlTy5EXfdnJy9u0iSL3ia8,50343
|
|
22
22
|
easyrip/ripper/sub_and_font/__init__.py,sha256=cBT7mxL7RRFaJXFPXuZ7RT-YK6FbnanaU5v6U9BOquw,153
|
|
23
23
|
easyrip/ripper/sub_and_font/ass.py,sha256=eGi1eIDWAV1Ti_BYIAcAMwrAlXJ5f_zGYte3nNu4PeE,25532
|
|
24
|
-
easyrip/ripper/sub_and_font/font.py,sha256=
|
|
24
|
+
easyrip/ripper/sub_and_font/font.py,sha256=DBtTi32deXES1ylZiZ0qzcv9zvRQRIYBAH9Zbwij3G0,8086
|
|
25
25
|
easyrip/ripper/sub_and_font/subset.py,sha256=VsFYTFuVWXW9ltkqWZIiwOIh-nGDKmW1tUv3oi5kpWw,17815
|
|
26
|
-
easyrip-4.
|
|
27
|
-
easyrip-4.
|
|
28
|
-
easyrip-4.
|
|
29
|
-
easyrip-4.
|
|
30
|
-
easyrip-4.
|
|
31
|
-
easyrip-4.
|
|
26
|
+
easyrip-4.7.0.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
27
|
+
easyrip-4.7.0.dist-info/METADATA,sha256=eume2bE0MFGaGnYxchUZM1U4Nc147fZjiYZQe0QDfWA,3506
|
|
28
|
+
easyrip-4.7.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
29
|
+
easyrip-4.7.0.dist-info/entry_points.txt,sha256=D6GBMMTzZ-apgX76KyZ6jxMmIFqGYwU9neeLLni_qKI,49
|
|
30
|
+
easyrip-4.7.0.dist-info/top_level.txt,sha256=kuEteBXm-Gf90jRQgH3-fTo-Z-Q6czSuUEqY158H4Ww,8
|
|
31
|
+
easyrip-4.7.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|