easyrip 3.13.4__tar.gz → 4.13.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.
Files changed (50) hide show
  1. easyrip-4.13.1/PKG-INFO +92 -0
  2. easyrip-4.13.1/README.md +65 -0
  3. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip/__init__.py +6 -11
  4. easyrip-4.13.1/easyrip/__main__.py +152 -0
  5. easyrip-4.13.1/easyrip/easyrip_command.py +914 -0
  6. easyrip-4.13.1/easyrip/easyrip_config/config.py +269 -0
  7. easyrip-4.13.1/easyrip/easyrip_config/config_key.py +28 -0
  8. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip/easyrip_log.py +116 -42
  9. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip/easyrip_main.py +544 -272
  10. easyrip-4.13.1/easyrip/easyrip_mlang/__init__.py +70 -0
  11. easyrip-4.13.1/easyrip/easyrip_mlang/global_lang_val.py +160 -0
  12. easyrip-4.13.1/easyrip/easyrip_mlang/lang_en.py +5 -0
  13. easyrip-3.13.4/easyrip/easyrip_mlang/global_lang_val.py → easyrip-4.13.1/easyrip/easyrip_mlang/lang_tag_val.py +3 -159
  14. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip/easyrip_mlang/lang_zh_Hans_CN.py +108 -87
  15. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip/easyrip_mlang/translator.py +45 -48
  16. easyrip-4.13.1/easyrip/easyrip_prompt.py +151 -0
  17. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip/easyrip_web/__init__.py +2 -1
  18. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip/easyrip_web/http_server.py +56 -42
  19. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip/easyrip_web/third_party_api.py +60 -8
  20. easyrip-4.13.1/easyrip/global_val.py +29 -0
  21. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip/ripper/media_info.py +7 -2
  22. easyrip-4.13.1/easyrip/ripper/param.py +531 -0
  23. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip/ripper/ripper.py +484 -764
  24. easyrip-4.13.1/easyrip/ripper/sub_and_font/__init__.py +10 -0
  25. {easyrip-3.13.4/easyrip/ripper/font_subset → easyrip-4.13.1/easyrip/ripper/sub_and_font}/ass.py +419 -179
  26. {easyrip-3.13.4/easyrip/ripper/font_subset → easyrip-4.13.1/easyrip/ripper/sub_and_font}/font.py +72 -79
  27. {easyrip-3.13.4/easyrip/ripper/font_subset → easyrip-4.13.1/easyrip/ripper/sub_and_font}/subset.py +123 -82
  28. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip/utils.py +129 -27
  29. easyrip-4.13.1/easyrip.egg-info/PKG-INFO +92 -0
  30. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip.egg-info/SOURCES.txt +10 -7
  31. easyrip-4.13.1/easyrip.egg-info/requires.txt +3 -0
  32. easyrip-4.13.1/pyproject.toml +50 -0
  33. easyrip-3.13.4/PKG-INFO +0 -89
  34. easyrip-3.13.4/README.md +0 -75
  35. easyrip-3.13.4/easyrip/__main__.py +0 -41
  36. easyrip-3.13.4/easyrip/easyrip_command.py +0 -554
  37. easyrip-3.13.4/easyrip/easyrip_config.py +0 -198
  38. easyrip-3.13.4/easyrip/easyrip_mlang/__init__.py +0 -104
  39. easyrip-3.13.4/easyrip/easyrip_mlang/lang_en.py +0 -5
  40. easyrip-3.13.4/easyrip/global_val.py +0 -5
  41. easyrip-3.13.4/easyrip/ripper/__init__.py +0 -10
  42. easyrip-3.13.4/easyrip/ripper/font_subset/__init__.py +0 -7
  43. easyrip-3.13.4/easyrip.egg-info/PKG-INFO +0 -89
  44. easyrip-3.13.4/easyrip.egg-info/requires.txt +0 -2
  45. easyrip-3.13.4/setup.py +0 -40
  46. {easyrip-3.13.4 → easyrip-4.13.1}/LICENSE +0 -0
  47. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip.egg-info/dependency_links.txt +0 -0
  48. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip.egg-info/entry_points.txt +0 -0
  49. {easyrip-3.13.4 → easyrip-4.13.1}/easyrip.egg-info/top_level.txt +0 -0
  50. {easyrip-3.13.4 → easyrip-4.13.1}/setup.cfg +0 -0
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.4
2
+ Name: easyrip
3
+ Version: 4.13.1
4
+ Author: op200
5
+ License-Expression: AGPL-3.0-or-later
6
+ Project-URL: Homepage, https://github.com/op200/EasyRip
7
+ Project-URL: Source, https://github.com/op200/EasyRip
8
+ Classifier: Topic :: Multimedia
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Python :: 3.14
13
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 10
14
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 11
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: End Users/Desktop
18
+ Classifier: Intended Audience :: Information Technology
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.12
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: prompt-toolkit>=3.0.52
24
+ Requires-Dist: fonttools>=4.61.1
25
+ Requires-Dist: pycryptodome>=3.23.0
26
+ Dynamic: license-file
27
+
28
+ # Easy Rip
29
+
30
+ Self-use codec tool
31
+ 自用压制工具
32
+
33
+ **[Easy Rip Web Panel
34
+ Easy Rip 网页版控制台](https://op200.github.io/EasyRip-WebPanel/)**
35
+
36
+ ## Start
37
+
38
+ 1. Install [Python](https://www.python.org/)
39
+ 安装 [Python](https://www.python.org/)
40
+ 2. Install Easy Rip using pip: `pip install -U easyrip`
41
+ 使用 pip 安装 Easy Rip: `pip install -U easyrip`
42
+ 3. The you can use Easy Rip directly, run the command `easyrip`
43
+ 然后你就可以直接 Easy Rip 了,运行命令 `easyrip`
44
+
45
+ * (If you have special requirements and want to use a separate file, you can download it from [Github Actions](https://github.com/op200/EasyRip/actions))
46
+ (如果你有特殊需求,想使用独立文件,可以在 [Github Actions](https://github.com/op200/EasyRip/actions) 中下载)
47
+ * (The file `BatchScriptPackage` in [Releases](https://github.com/op200/EasyRip/releases) is a bat script collection. It is used to facilitate ordinary users, it only has Chinese.)
48
+ ([Releases](https://github.com/op200/EasyRip/releases) 中每隔一段时间发布一次名为 `BatchScriptPackage` 的 bat 脚本包,用于方便一般用户,其内只有中文。)
49
+
50
+ ## Usage
51
+
52
+ Run `easyrip`, input `help` to get help doc
53
+ 运行 `easyrip`,键入 `help` 获取帮助文档
54
+
55
+ [View usage in wiki
56
+ 在 Wiki 中查看用法](https://github.com/op200/EasyRip/wiki)
57
+
58
+ ## Dependency
59
+
60
+ * ### Python 3.14 (must >=3.12)
61
+
62
+ If you want to develop, you need to install dependencies. If you just want to use them, you don't need to manually install dependencies.
63
+ 如果你想开发,需要安装依赖,如果你只是想使用,不需要手动安装依赖。
64
+
65
+ ```pwsh
66
+ pip install -U prompt-toolkit fonttools pycryptodome
67
+ ```
68
+
69
+ * [prompt-toolkit](https://pypi.org/project/prompt-toolkit/)
70
+ * [fonttools](https://pypi.org/project/fonttools/)
71
+ * [pycryptodome](https://pypi.org/project/pycryptodome/)
72
+
73
+ * ### CLI
74
+
75
+ Command line dependencies are necessary.
76
+ 命令行依赖是必须的。
77
+
78
+ * [ffmpeg & ffprobe](https://ffmpeg.org/)
79
+ * [flac](https://xiph.org/flac/)
80
+ * [mp4box](https://gpac.io/)
81
+ * [mp4fpsmod](https://github.com/nu774/mp4fpsmod)
82
+ * [mkvpropedit & mkvmerge](https://mkvtoolnix.download/)
83
+ <!-- * [MediaInfo](https://mediaarea.net/en/MediaInfo) -->
84
+
85
+ ## Supported languages
86
+
87
+ * en
88
+ * zh-Hans-CN
89
+
90
+ If you want to add or modify translation, edit the `easyrip/easyrip_mlang`
91
+
92
+ Or add translate file, see [Wiki](https://github.com/op200/EasyRip/wiki/Language-file) for details
@@ -0,0 +1,65 @@
1
+ # Easy Rip
2
+
3
+ Self-use codec tool
4
+ 自用压制工具
5
+
6
+ **[Easy Rip Web Panel
7
+ Easy Rip 网页版控制台](https://op200.github.io/EasyRip-WebPanel/)**
8
+
9
+ ## Start
10
+
11
+ 1. Install [Python](https://www.python.org/)
12
+ 安装 [Python](https://www.python.org/)
13
+ 2. Install Easy Rip using pip: `pip install -U easyrip`
14
+ 使用 pip 安装 Easy Rip: `pip install -U easyrip`
15
+ 3. The you can use Easy Rip directly, run the command `easyrip`
16
+ 然后你就可以直接 Easy Rip 了,运行命令 `easyrip`
17
+
18
+ * (If you have special requirements and want to use a separate file, you can download it from [Github Actions](https://github.com/op200/EasyRip/actions))
19
+ (如果你有特殊需求,想使用独立文件,可以在 [Github Actions](https://github.com/op200/EasyRip/actions) 中下载)
20
+ * (The file `BatchScriptPackage` in [Releases](https://github.com/op200/EasyRip/releases) is a bat script collection. It is used to facilitate ordinary users, it only has Chinese.)
21
+ ([Releases](https://github.com/op200/EasyRip/releases) 中每隔一段时间发布一次名为 `BatchScriptPackage` 的 bat 脚本包,用于方便一般用户,其内只有中文。)
22
+
23
+ ## Usage
24
+
25
+ Run `easyrip`, input `help` to get help doc
26
+ 运行 `easyrip`,键入 `help` 获取帮助文档
27
+
28
+ [View usage in wiki
29
+ 在 Wiki 中查看用法](https://github.com/op200/EasyRip/wiki)
30
+
31
+ ## Dependency
32
+
33
+ * ### Python 3.14 (must >=3.12)
34
+
35
+ If you want to develop, you need to install dependencies. If you just want to use them, you don't need to manually install dependencies.
36
+ 如果你想开发,需要安装依赖,如果你只是想使用,不需要手动安装依赖。
37
+
38
+ ```pwsh
39
+ pip install -U prompt-toolkit fonttools pycryptodome
40
+ ```
41
+
42
+ * [prompt-toolkit](https://pypi.org/project/prompt-toolkit/)
43
+ * [fonttools](https://pypi.org/project/fonttools/)
44
+ * [pycryptodome](https://pypi.org/project/pycryptodome/)
45
+
46
+ * ### CLI
47
+
48
+ Command line dependencies are necessary.
49
+ 命令行依赖是必须的。
50
+
51
+ * [ffmpeg & ffprobe](https://ffmpeg.org/)
52
+ * [flac](https://xiph.org/flac/)
53
+ * [mp4box](https://gpac.io/)
54
+ * [mp4fpsmod](https://github.com/nu774/mp4fpsmod)
55
+ * [mkvpropedit & mkvmerge](https://mkvtoolnix.download/)
56
+ <!-- * [MediaInfo](https://mediaarea.net/en/MediaInfo) -->
57
+
58
+ ## Supported languages
59
+
60
+ * en
61
+ * zh-Hans-CN
62
+
63
+ If you want to add or modify translation, edit the `easyrip/easyrip_mlang`
64
+
65
+ Or add translate file, see [Wiki](https://github.com/op200/EasyRip/wiki/Language-file) for details
@@ -7,22 +7,16 @@ from .easyrip_main import (
7
7
  init,
8
8
  run_command,
9
9
  )
10
- from .easyrip_mlang import (
11
- Global_lang_val,
12
- Lang_tag,
13
- Lang_tag_language,
14
- Lang_tag_region,
15
- Lang_tag_script,
16
- )
17
- from .ripper import Ass, Media_info, Ripper
10
+ from .easyrip_mlang import Global_lang_val, Lang_tag
11
+ from .ripper.media_info import Media_info
12
+ from .ripper.ripper import Ripper
13
+ from .ripper.sub_and_font import Ass, Font, load_fonts
18
14
 
19
15
  __all__ = [
20
16
  "Ass",
17
+ "Font",
21
18
  "Global_lang_val",
22
19
  "Lang_tag",
23
- "Lang_tag_language",
24
- "Lang_tag_region",
25
- "Lang_tag_script",
26
20
  "Media_info",
27
21
  "Ripper",
28
22
  "check_env",
@@ -30,6 +24,7 @@ __all__ = [
30
24
  "gettext",
31
25
  "global_val",
32
26
  "init",
27
+ "load_fonts",
33
28
  "log",
34
29
  "run_command",
35
30
  ]
@@ -0,0 +1,152 @@
1
+ import sys
2
+ from collections.abc import Coroutine, Iterable
3
+ from typing import Any, NoReturn
4
+
5
+ import Crypto
6
+ import fontTools
7
+ import prompt_toolkit
8
+ from prompt_toolkit import ANSI, prompt
9
+ from prompt_toolkit.completion import merge_completers
10
+ from prompt_toolkit.history import InMemoryHistory
11
+ from prompt_toolkit.input.ansi_escape_sequences import ANSI_SEQUENCES
12
+ from prompt_toolkit.key_binding import KeyBindings, KeyPressEvent
13
+ from prompt_toolkit.key_binding.bindings import named_commands
14
+ from prompt_toolkit.keys import Keys
15
+
16
+ from .easyrip_command import (
17
+ Cmd_type,
18
+ Cmd_type_val,
19
+ CmdCompleter,
20
+ Opt_type,
21
+ OptCompleter,
22
+ nested_dict,
23
+ )
24
+ from .easyrip_config.config import Config_key, config
25
+ from .easyrip_main import Ripper, get_input_prompt, init, log, run_command
26
+ from .easyrip_prompt import ConfigFileHistory, SmartPathCompleter, easyrip_prompt
27
+ from .global_val import C_D, C_Z
28
+
29
+
30
+ def run() -> NoReturn:
31
+ init(True)
32
+
33
+ log.debug(f"Python: v{sys.version}")
34
+ log.debug(f"prompt-toolkit: v{prompt_toolkit.__version__}")
35
+ log.debug(f"fonttools: v{fontTools.__version__}")
36
+ log.debug(f"pycryptodome: v{Crypto.__version__}")
37
+
38
+ if len(sys.argv) > 1:
39
+ run_command(sys.argv[1:])
40
+ if len(Ripper.ripper_list) == 0:
41
+ sys.exit(0)
42
+
43
+ key_bindings = KeyBindings()
44
+
45
+ @key_bindings.add(Keys.ControlC)
46
+ def _(event: KeyPressEvent) -> None:
47
+ event.app.exit(exception=KeyboardInterrupt, style="class:exiting")
48
+
49
+ @key_bindings.add(Keys.ControlD)
50
+ def _(event: KeyPressEvent) -> None:
51
+ event.app.current_buffer.insert_text(C_D)
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
+
61
+ path_completer = SmartPathCompleter()
62
+
63
+ def _ctv_to_nc(ctvs: Iterable[Cmd_type_val]) -> CmdCompleter:
64
+ return CmdCompleter(
65
+ {
66
+ name: (
67
+ merge_completers(completer_tuple)
68
+ if (
69
+ completer_tuple := (
70
+ *((_ctv_to_nc(ctv.childs),) if ctv.childs else ()),
71
+ *(
72
+ (path_completer,)
73
+ if name
74
+ in {
75
+ *Cmd_type.cd.value.names,
76
+ *Cmd_type.mediainfo.value.names,
77
+ *Cmd_type.assinfo.value.names,
78
+ *Cmd_type.fontinfo.value.names,
79
+ }
80
+ else ()
81
+ ),
82
+ )
83
+ )
84
+ else None
85
+ )
86
+ for ctv in ctvs
87
+ for name in ctv.names
88
+ }
89
+ )
90
+
91
+ def _ctv_to_nd(ctvs: Iterable[Cmd_type_val]) -> nested_dict:
92
+ return {
93
+ name: (
94
+ merge_completers(
95
+ (OptCompleter(opt_tree=_ctv_to_nd(ctv.childs)), path_completer)
96
+ )
97
+ if name
98
+ in {
99
+ *Opt_type._i.value.names,
100
+ *Opt_type._o_dir.value.names,
101
+ *Opt_type._o.value.names,
102
+ *Opt_type._pipe.value.names,
103
+ *Opt_type._sub.value.names,
104
+ *Opt_type._only_mux_sub_path.value.names,
105
+ *Opt_type._soft_sub.value.names,
106
+ *Opt_type._subset_font_dir.value.names,
107
+ *Opt_type._chapters.value.names,
108
+ }
109
+ else _ctv_to_nd(ctv.childs)
110
+ )
111
+ for ctv in ctvs
112
+ for name in ctv.names
113
+ }
114
+
115
+ cmd_ctv_tuple = tuple(ct.value for ct in Cmd_type if ct != Cmd_type.Option)
116
+ prompt_history = (
117
+ ConfigFileHistory(easyrip_prompt.PROMPT_HISTORY_FILE)
118
+ if config.get_user_profile(Config_key.save_prompt_history)
119
+ else InMemoryHistory()
120
+ )
121
+
122
+ while True:
123
+ try:
124
+ command = prompt(
125
+ ANSI(get_input_prompt(is_color=True)),
126
+ key_bindings=key_bindings,
127
+ completer=merge_completers(
128
+ (
129
+ _ctv_to_nc(cmd_ctv_tuple),
130
+ OptCompleter(opt_tree=_ctv_to_nd(ct.value for ct in Opt_type)),
131
+ )
132
+ ),
133
+ history=prompt_history,
134
+ complete_while_typing=True,
135
+ )
136
+ if command.startswith(C_Z):
137
+ raise EOFError
138
+ except KeyboardInterrupt:
139
+ continue
140
+ except EOFError:
141
+ log.debug("Manually force exit")
142
+ sys.exit(0)
143
+
144
+ try:
145
+ if not run_command(command):
146
+ log.warning("Command run terminated")
147
+ except KeyboardInterrupt:
148
+ log.warning("Manually stop run command")
149
+
150
+
151
+ if __name__ == "__main__":
152
+ run()