easyrip 4.8.2__tar.gz → 4.9.1__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.
- {easyrip-4.8.2 → easyrip-4.9.1}/PKG-INFO +1 -1
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/__main__.py +12 -2
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/global_val.py +1 -1
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/ripper/ripper.py +2 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/ripper/sub_and_font/font.py +0 -9
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/ripper/sub_and_font/subset.py +19 -13
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip.egg-info/PKG-INFO +1 -1
- {easyrip-4.8.2 → easyrip-4.9.1}/LICENSE +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/README.md +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/__init__.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_command.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_config/config.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_config/config_key.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_log.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_main.py +1 -1
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_mlang/__init__.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_mlang/global_lang_val.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_mlang/lang_en.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_mlang/lang_zh_Hans_CN.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_mlang/translator.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_prompt.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_web/__init__.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_web/http_server.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/easyrip_web/third_party_api.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/ripper/media_info.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/ripper/param.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/ripper/sub_and_font/__init__.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/ripper/sub_and_font/ass.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip/utils.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip.egg-info/SOURCES.txt +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip.egg-info/dependency_links.txt +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip.egg-info/entry_points.txt +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip.egg-info/requires.txt +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/easyrip.egg-info/top_level.txt +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/pyproject.toml +0 -0
- {easyrip-4.8.2 → easyrip-4.9.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import sys
|
|
2
|
-
from collections.abc import Iterable
|
|
3
|
-
from typing import NoReturn
|
|
2
|
+
from collections.abc import Coroutine, Iterable
|
|
3
|
+
from typing import Any, NoReturn
|
|
4
4
|
|
|
5
5
|
import Crypto
|
|
6
6
|
import fontTools
|
|
@@ -8,7 +8,9 @@ import prompt_toolkit
|
|
|
8
8
|
from prompt_toolkit import ANSI, prompt
|
|
9
9
|
from prompt_toolkit.completion import merge_completers
|
|
10
10
|
from prompt_toolkit.history import InMemoryHistory
|
|
11
|
+
from prompt_toolkit.input.ansi_escape_sequences import ANSI_SEQUENCES
|
|
11
12
|
from prompt_toolkit.key_binding import KeyBindings, KeyPressEvent
|
|
13
|
+
from prompt_toolkit.key_binding.bindings import named_commands
|
|
12
14
|
from prompt_toolkit.keys import Keys
|
|
13
15
|
|
|
14
16
|
from .easyrip_command import (
|
|
@@ -48,6 +50,14 @@ def run() -> NoReturn:
|
|
|
48
50
|
def _(event: KeyPressEvent) -> None:
|
|
49
51
|
event.app.current_buffer.insert_text(C_D)
|
|
50
52
|
|
|
53
|
+
ANSI_SEQUENCES["\x08"] = Keys.F24
|
|
54
|
+
|
|
55
|
+
@key_bindings.add(Keys.F24)
|
|
56
|
+
def _(
|
|
57
|
+
event: KeyPressEvent,
|
|
58
|
+
) -> object | Coroutine[Any, Any, object]:
|
|
59
|
+
return named_commands.get_by_name("unix-word-rubout").handler(event)
|
|
60
|
+
|
|
51
61
|
path_completer = SmartPathCompleter()
|
|
52
62
|
|
|
53
63
|
def _ctv_to_nc(ctvs: Iterable[Cmd_type_val]) -> CmdCompleter:
|
|
@@ -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.9.1"
|
|
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"
|
|
@@ -1051,6 +1051,7 @@ class Ripper:
|
|
|
1051
1051
|
# 处理 soft-sub
|
|
1052
1052
|
soft_sub_list: list[Path]
|
|
1053
1053
|
soft_sub_map_list: list[str] = soft_sub.split(":")
|
|
1054
|
+
|
|
1054
1055
|
if soft_sub_map_list[0] == "auto":
|
|
1055
1056
|
soft_sub_list = []
|
|
1056
1057
|
|
|
@@ -1075,6 +1076,7 @@ class Ripper:
|
|
|
1075
1076
|
)
|
|
1076
1077
|
):
|
|
1077
1078
|
soft_sub_list.append(Path(self.output_dir) / _file_basename)
|
|
1079
|
+
|
|
1078
1080
|
else:
|
|
1079
1081
|
soft_sub_list = [Path(s) for s in soft_sub.split("?")]
|
|
1080
1082
|
|
|
@@ -190,17 +190,8 @@ def subset_font(font: Font, subset_str: str, affix: str) -> tuple[TTFont, bool]:
|
|
|
190
190
|
|
|
191
191
|
# 创建子集化选项
|
|
192
192
|
options = subset.Options()
|
|
193
|
-
options.drop_tables = ["DSIG", "PCLT", "EBDT", "EBSC"] # 不移除任何可能有用的表
|
|
194
193
|
options.hinting = True # 保留 hinting
|
|
195
194
|
options.name_IDs = [] # 不保留 name 表记录
|
|
196
|
-
options.no_subset_tables = subset.Options._no_subset_tables_default + [
|
|
197
|
-
"BASE",
|
|
198
|
-
"mort",
|
|
199
|
-
]
|
|
200
|
-
# options.drop_tables = []
|
|
201
|
-
options.name_legacy = True
|
|
202
|
-
# options.retain_gids = True
|
|
203
|
-
options.layout_features = ["*"]
|
|
204
195
|
|
|
205
196
|
# 创建子集化器
|
|
206
197
|
subsetter = subset.Subsetter(options=options)
|
|
@@ -133,6 +133,7 @@ def subset(
|
|
|
133
133
|
current_font_sign: tuple[str, Font_type] = default_font_sign
|
|
134
134
|
for is_tag, text in Event_data.parse_text(event.Text, use_libass_spec):
|
|
135
135
|
if is_tag:
|
|
136
|
+
tag_fn_org: str | None = None
|
|
136
137
|
tag_fn: str | None = None
|
|
137
138
|
tag_bold: str | None = None
|
|
138
139
|
tag_italic: str | None = None
|
|
@@ -151,7 +152,7 @@ def subset(
|
|
|
151
152
|
|
|
152
153
|
match tag:
|
|
153
154
|
case "fn":
|
|
154
|
-
tag_fn = proc_value
|
|
155
|
+
tag_fn_org, tag_fn = value, proc_value
|
|
155
156
|
case "b":
|
|
156
157
|
tag_bold = proc_value
|
|
157
158
|
case "i":
|
|
@@ -183,7 +184,7 @@ def subset(
|
|
|
183
184
|
|
|
184
185
|
# 修改
|
|
185
186
|
text = text.replace(
|
|
186
|
-
f"\\fn{
|
|
187
|
+
f"\\fn{tag_fn_org}",
|
|
187
188
|
f"\\fn{'@' if _is_vertical else ''}{get_font_new_name(new_fontname)}",
|
|
188
189
|
)
|
|
189
190
|
|
|
@@ -309,44 +310,49 @@ def subset(
|
|
|
309
310
|
case Font_type.Regular:
|
|
310
311
|
if (
|
|
311
312
|
(_k := (key[0], Font_type.Bold)) in font_sign__font
|
|
312
|
-
or (_k := (key[0], Font_type.Bold_Italic)) in font_sign__font
|
|
313
313
|
or (_k := (key[0], Font_type.Italic)) in font_sign__font
|
|
314
|
+
or (_k := (key[0], Font_type.Bold_Italic)) in font_sign__font
|
|
314
315
|
):
|
|
315
316
|
_font = font_sign__font[_k]
|
|
316
317
|
|
|
317
318
|
case Font_type.Bold:
|
|
318
319
|
if (
|
|
319
|
-
(_k := (key[0], Font_type.
|
|
320
|
-
or (_k := (key[0], Font_type.
|
|
320
|
+
(_k := (key[0], Font_type.Regular)) in font_sign__font
|
|
321
|
+
or (_k := (key[0], Font_type.Bold_Italic)) in font_sign__font
|
|
321
322
|
or (_k := (key[0], Font_type.Italic)) in font_sign__font
|
|
322
323
|
):
|
|
323
324
|
_font = font_sign__font[_k]
|
|
324
325
|
|
|
325
326
|
case Font_type.Italic:
|
|
326
|
-
if (
|
|
327
|
-
_k := (key[0], Font_type.
|
|
328
|
-
|
|
327
|
+
if (
|
|
328
|
+
(_k := (key[0], Font_type.Regular)) in font_sign__font
|
|
329
|
+
or (_k := (key[0], Font_type.Bold_Italic)) in font_sign__font
|
|
330
|
+
or (_k := (key[0], Font_type.Bold)) in font_sign__font
|
|
331
|
+
):
|
|
329
332
|
_font = font_sign__font[_k]
|
|
330
333
|
|
|
331
334
|
case Font_type.Bold_Italic:
|
|
332
|
-
if (
|
|
333
|
-
_k := (key[0], Font_type.
|
|
334
|
-
|
|
335
|
+
if (
|
|
336
|
+
(_k := (key[0], Font_type.Bold)) in font_sign__font
|
|
337
|
+
or (_k := (key[0], Font_type.Italic)) in font_sign__font
|
|
338
|
+
or (_k := (key[0], Font_type.Regular)) in font_sign__font
|
|
339
|
+
):
|
|
335
340
|
_font = font_sign__font[_k]
|
|
336
341
|
|
|
337
342
|
# 模糊字重也找不到字体
|
|
338
343
|
if _font is None:
|
|
344
|
+
_want_font_sign_str = f"( {key[0]} / {key[1].name} )"
|
|
339
345
|
if (_f_low := key[0].lower()) in family_lower__family:
|
|
340
346
|
log.error(
|
|
341
347
|
"{} not found. Skip it. Perhaps you want the {}",
|
|
342
|
-
|
|
348
|
+
_want_font_sign_str,
|
|
343
349
|
f"'{family_lower__family[_f_low]}'",
|
|
344
350
|
deep=strict,
|
|
345
351
|
)
|
|
346
352
|
else:
|
|
347
353
|
log.error(
|
|
348
354
|
"{} not found. Skip it",
|
|
349
|
-
|
|
355
|
+
_want_font_sign_str,
|
|
350
356
|
deep=strict,
|
|
351
357
|
)
|
|
352
358
|
return_res = False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -37,8 +37,8 @@ from .easyrip_mlang import (
|
|
|
37
37
|
)
|
|
38
38
|
from .easyrip_prompt import easyrip_prompt
|
|
39
39
|
from .ripper.media_info import Media_info
|
|
40
|
-
from .ripper.ripper import Ripper
|
|
41
40
|
from .ripper.param import DEFAULT_PRESET_PARAMS, PRESET_OPT_NAME
|
|
41
|
+
from .ripper.ripper import Ripper
|
|
42
42
|
from .ripper.sub_and_font import load_fonts
|
|
43
43
|
from .utils import change_title, check_ver, read_text
|
|
44
44
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|