easyrip 4.6.0__tar.gz → 4.7.0__tar.gz

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 (36) hide show
  1. {easyrip-4.6.0 → easyrip-4.7.0}/PKG-INFO +1 -1
  2. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_log.py +1 -1
  3. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_main.py +1 -2
  4. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_mlang/lang_zh_Hans_CN.py +1 -1
  5. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/global_val.py +1 -1
  6. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/ripper/ripper.py +6 -2
  7. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/ripper/sub_and_font/font.py +5 -5
  8. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/utils.py +14 -14
  9. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip.egg-info/PKG-INFO +1 -1
  10. {easyrip-4.6.0 → easyrip-4.7.0}/LICENSE +0 -0
  11. {easyrip-4.6.0 → easyrip-4.7.0}/README.md +0 -0
  12. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/__init__.py +0 -0
  13. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/__main__.py +0 -0
  14. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_command.py +0 -0
  15. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_config/config.py +0 -0
  16. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_config/config_key.py +0 -0
  17. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_mlang/__init__.py +0 -0
  18. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_mlang/global_lang_val.py +0 -0
  19. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_mlang/lang_en.py +0 -0
  20. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_mlang/translator.py +0 -0
  21. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_prompt.py +0 -0
  22. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_web/__init__.py +0 -0
  23. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_web/http_server.py +0 -0
  24. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/easyrip_web/third_party_api.py +0 -0
  25. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/ripper/media_info.py +0 -0
  26. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/ripper/param.py +0 -0
  27. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/ripper/sub_and_font/__init__.py +0 -0
  28. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/ripper/sub_and_font/ass.py +0 -0
  29. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip/ripper/sub_and_font/subset.py +0 -0
  30. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip.egg-info/SOURCES.txt +0 -0
  31. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip.egg-info/dependency_links.txt +0 -0
  32. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip.egg-info/entry_points.txt +0 -0
  33. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip.egg-info/requires.txt +0 -0
  34. {easyrip-4.6.0 → easyrip-4.7.0}/easyrip.egg-info/top_level.txt +0 -0
  35. {easyrip-4.6.0 → easyrip-4.7.0}/pyproject.toml +0 -0
  36. {easyrip-4.6.0 → easyrip-4.7.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easyrip
3
- Version: 4.6.0
3
+ Version: 4.7.0
4
4
  Author: op200
5
5
  License-Expression: AGPL-3.0-or-later
6
6
  Project-URL: Homepage, https://github.com/op200/EasyRip
@@ -106,7 +106,7 @@ class log:
106
106
  only_print = enum.auto()
107
107
  only_write = enum.auto()
108
108
 
109
- html_filename: str = "encoding_log.html" # 在调用前覆写
109
+ html_filename: str = "EasyRip_log.html" # 在调用前覆写
110
110
  print_level: LogLevel = LogLevel.send
111
111
  write_level: LogLevel = LogLevel.send
112
112
 
@@ -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("encoding_log.html")
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
- "encoding_log.html": "编码日志.html",
311
+ "EasyRip_log.html": "EasyRip日志.html",
312
312
  "Start": "开始",
313
313
  "Input file pathname": "输入文件路径名",
314
314
  "Output directory": "输出目录",
@@ -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.0"
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"
@@ -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("pix_fmt"),
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("pix_fmt"),
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 ((suffix := file.suffix.lower()) in {".ttf", ".otf", ".ttc"})
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
- "Font {} is Regular but Bold={} and Italic={}. Skip this font",
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"Font {file} does not have an English subfamily name. Defaulting to Regular"
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'Error loading font file "{file}": {e}')
143
+ log.error(f'Failed to load font file "{file}": {e}')
144
144
  except Exception as e:
145
- log.error(f"Unexpected error for font {file}: {e}")
145
+ log.error(f'Unexpected error when load font "{file}": {e}')
146
146
 
147
147
  return res_font_list
148
148
 
@@ -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, b: type) -> bool:
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
- b: 目标类型,可以是普通类型或泛型
225
+ t: 目标类型,可以是普通类型或泛型
226
226
 
227
227
  Returns:
228
228
  bool: 值是否匹配目标类型
229
229
 
230
230
  """
231
- b_org = get_origin(b)
231
+ t_org = get_origin(t)
232
232
 
233
233
  # 如果不是泛型类型,直接使用 isinstance
234
- if b_org is None:
235
- return isinstance(val, b)
234
+ if t_org is None:
235
+ return isinstance(val, t)
236
236
 
237
237
  # 首先检查是否是 b_org 的实例
238
- if not isinstance(val, b_org):
238
+ if not isinstance(val, t_org):
239
239
  return False
240
240
 
241
241
  # 获取类型参数
242
- args = get_args(b)
242
+ args = get_args(t)
243
243
  if not args: # 没有类型参数,如 List
244
244
  return True
245
245
 
246
246
  # 根据不同的原始类型进行检查
247
- if b_org is list:
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 b_org is tuple:
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 b_org is dict:
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 b_org is set:
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 b_org is frozenset:
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(b_org, "__name__") and b_org.__name__ == "Union":
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easyrip
3
- Version: 4.6.0
3
+ Version: 4.7.0
4
4
  Author: op200
5
5
  License-Expression: AGPL-3.0-or-later
6
6
  Project-URL: Homepage, https://github.com/op200/EasyRip
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes