Johnserf-Seed / f2

High-speed downloader for multiple platforms
https://johnserf-seed.github.io/f2/
Apache License 2.0
314 stars 61 forks source link

[BUG]不知为何的报错无法运行 #101

Closed specked2527 closed 2 weeks ago

specked2527 commented 2 weeks ago

详细描述错误 简明扼要地描述遇到的错误。 不知为何的报错无法运行 系统平台

单击展开 Q:你在哪个平台(Win/Linux/Mac)上运行?你使用的是什么浏览器?你使用的是什么终端软件?你使用的F2是什么版本? A: win10,cmd,f2/0.1.5 - 操作系统: [e.g. Win10 x64 22H2 19045.4046] - 浏览器 [e.g. Edge 122.0.2365.52] - 终端 [e.g. WT 1.18.10301.0] - F2版本 [e.g. 0.0.1.5]

错误重现

单击展开 Q: 请你复制并粘贴出错时运行的命令和配置文件内容,以及重现该行为的步骤。如果你一次性就提供完整信息,就会节省很多解决问题的时间。 ```py A: Microsoft Windows [版本 10.0.19045.4529] (c) Microsoft Corporation。保留所有权利。 管理员i>f2 -d DEBUG dy -M one -u https://v.douyin.com/iRNBho6u/ -c conf/app.yaml 管理员DEBUG 开启调试模式 (Debug mode on) INFO App: douyin ╭──────────────────────── Traceback (most recent call last) ─────────────────────────╮│ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\runpy.py:196 in ││ _run_module_as_main ││ ││ 193 │ main_globals = sys.modules["__main__"].__dict__ ││ 194 │ if alter_argv: ││ 195 │ │ sys.argv[0] = mod_spec.origin ││ ❱ 196 │ return _run_code(code, main_globals, None, ││ 197 │ │ │ │ │ "__main__", mod_spec) ││ 198 ││ 199 def run_module(mod_name, init_globals=None, ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\runpy.py:86 in _run_code ││ ││ 83 │ │ │ │ │ __loader__ = loader, ││ 84 │ │ │ │ │ __package__ = pkg_name, ││ 85 │ │ │ │ │ __spec__ = mod_spec) ││ ❱ 86 │ exec(code, run_globals) ││ 87 │ return run_globals ││ 88 ││ 89 def _run_module_code(code, init_globals=None, ││ ││ in :7 ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core. ││ py:1157 in __call__ ││ ││ 1154 │ ││ 1155 │ def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Any: ││ 1156 │ │ """Alias for :meth:`main`.""" ││ ❱ 1157 │ │ return self.main(*args, **kwargs) ││ 1158 ││ 1159 ││ 1160 class Command(BaseCommand): ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core. ││ py:1078 in main ││ ││ 1075 │ │ try: ││ 1076 │ │ │ try: ││ 1077 │ │ │ │ with self.make_context(prog_name, args, **extra) as ctx: ││ ❱ 1078 │ │ │ │ │ rv = self.invoke(ctx) ││ 1079 │ │ │ │ │ if not standalone_mode: ││ 1080 │ │ │ │ │ │ return rv ││ 1081 │ │ │ │ │ # it's not safe to `ctx.exit(rv)` here! ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core. ││ py:1688 in invoke ││ ││ 1685 │ │ │ │ super().invoke(ctx) ││ 1686 │ │ │ │ sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) ││ 1687 │ │ │ │ with sub_ctx: ││ ❱ 1688 │ │ │ │ │ return _process_result(sub_ctx.command.invoke(sub_ctx)) ││ 1689 │ │ ││ 1690 │ │ # In chain mode we create the contexts step by step, but after the ││ 1691 │ │ # base command has been invoked. Because at that point we do not ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core. ││ py:1434 in invoke ││ ││ 1431 │ │ │ echo(style(message, fg="red"), err=True) ││ 1432 │ │ ││ 1433 │ │ if self.callback is not None: ││ ❱ 1434 │ │ │ return ctx.invoke(self.callback, **ctx.params) ││ 1435 │ ││ 1436 │ def shell_complete(self, ctx: Context, incomplete: str) -> t.List["Comp ││ 1437 │ │ """Return a list of completions for the incomplete value. Looks ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core. ││ py:783 in invoke ││ ││ 780 │ │ ││ 781 │ │ with augment_usage_errors(__self): ││ 782 │ │ │ with ctx: ││ ❱ 783 │ │ │ │ return __callback(*args, **kwargs) ││ 784 │ ││ 785 │ def forward( ││ 786 │ │ __self, __cmd: "Command", *args: t.Any, **kwargs: t.Any # noqa: B9 ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\click\decor ││ ators.py:33 in new_func ││ ││ 30 │ """ ││ 31 │ ││ 32 │ def new_func(*args: "P.args", **kwargs: "P.kwargs") -> "R": ││ ❱ 33 │ │ return f(get_current_context(), *args, **kwargs) ││ 34 │ ││ 35 │ return update_wrapper(new_func, f) ││ 36 ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\f2\apps\dou ││ yin\cli.py:374 in douyin ││ ││ 371 │ ################## ││ 372 │ ││ 373 │ # 读取低频主配置文件 ││ ❱ 374 │ main_manager = ConfigManager(f2.APP_CONFIG_FILE_PATH) ││ 375 │ main_conf_path = get_resource_path(f2.APP_CONFIG_FILE_PATH) ││ 376 │ main_conf = main_manager.get_config("douyin") ││ 377 ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\f2\utils\co ││ nf_manager.py:24 in __init__ ││ ││ 21 │ │ │ self.filepath = Path(filepath) ││ 22 │ │ else: ││ 23 │ │ │ self.filepath = Path(get_resource_path(filepath)) ││ ❱ 24 │ │ self.config = self.load_config() ││ 25 │ ││ 26 │ def load_config(self) -> dict: ││ 27 │ │ """从文件中加载配置 (Load the conf from the file)""" ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\f2\utils\co ││ nf_manager.py:32 in load_config ││ ││ 29 │ │ if not self.filepath.exists(): ││ 30 │ │ │ raise FileNotFound(_("配置文件不存在"), self.filepath) ││ 31 │ │ ││ ❱ 32 │ │ return yaml.safe_load(self.filepath.read_text(encoding="utf-8")) or ││ 33 │ ││ 34 │ def get_config(self, app_name: str, default=None) -> dict: ││ 35 │ │ """ ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\yaml\__init ││ __.py:125 in safe_load ││ ││ 122 │ Resolve only basic YAML tags. This is known ││ 123 │ to be safe for untrusted input. ││ 124 │ """ ││ ❱ 125 │ return load(stream, SafeLoader) ││ 126 ││ 127 def safe_load_all(stream): ││ 128 │ """ ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\yaml\__init ││ __.py:81 in load ││ ││ 78 │ """ ││ 79 │ loader = Loader(stream) ││ 80 │ try: ││ ❱ 81 │ │ return loader.get_single_data() ││ 82 │ finally: ││ 83 │ │ loader.dispose() ││ 84 ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\yaml\constr ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\yaml\scanne ││ r.py:116 in check_token ││ ││ 113 │ def check_token(self, *choices): ││ 114 │ │ # Check if the next token is one of the given types. ││ 115 │ │ while self.need_more_tokens(): ││ ❱ 116 │ │ │ self.fetch_more_tokens() ││ 117 │ │ if self.tokens: ││ 118 │ │ │ if not choices: ││ 119 │ │ │ │ return True ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\yaml\scanne ││ r.py:223 in fetch_more_tokens ││ ││ 220 │ │ ││ 221 │ │ # Is it the value indicator? ││ 222 │ │ if ch == ':' and self.check_value(): ││ ❱ 223 │ │ │ return self.fetch_value() ││ 224 │ │ ││ 225 │ │ # Is it an alias? ││ 226 │ │ if ch == '*': ││ ││ C:\Users\ioi\AppData\Local\Programs\Python\Python310\lib\site-packages\yaml\scanne ││ r.py:577 in fetch_value ││ ││ 574 │ │ │ │ # We are allowed to start a complex value if and only if ││ 575 │ │ │ │ # we can start a simple key. ││ 576 │ │ │ │ if not self.allow_simple_key: ││ ❱ 577 │ │ │ │ │ raise ScannerError(None, None, ││ 578 │ │ │ │ │ │ │ "mapping values are not allowed here", ││ 579 │ │ │ │ │ │ │ self.get_mark()) ││ 580 │╰────────────────────────────────────────────────────────────────────────────────────╯ScannerError: mapping values are not allowed here in "", line 4, column 9: naming: '{create}_{desc}' ^ ``` Q: 请添加调试命令`f2 -d DEBUG`重新运行出错的命令并提供日志目录下的日志文件。 A: Q: 如果是开发者请提供最小的代码示例 A: ```python f2 -d DEBUG dy -M one -u https://v.douyin.com/iRNBho6u/ -c conf/app.yaml ```

预期行为 简明扼要地描述期望发生的事情。 运行程序 屏幕截图 请添加截图以帮助解释你的问题。

日志文件 请添加调试日志文件以帮助解释你的问题。

其他 如有,可以添加有关问题的其他信息。

Johnserf-Seed commented 2 weeks ago

https://github.com/Johnserf-Seed/f2/issues/104