Johnserf-Seed / f2

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

[BUG]wb接口问题:接口 JSON 失败:'utf-8' codec can't decode byte 0xd0 in position 28: invalid continuation byte #169

Open CCMonkeyss opened 3 months ago

CCMonkeyss commented 3 months ago

详细描述错误 wb下载错误,使用指令 f2 wb -p /Users/jun/Downloads -M one -u https://weibo.com/2005144907/Os9PT4cM7, 出现:接口 JSON 失败:'utf-8' codec can't decode byte 0xd0 in position 28: invalid
continuation byte

系统平台

单击展开 Q:你在哪个平台(Win/Linux/Mac)上运行?你使用的是什么浏览器?你使用的是什么终端软件?你使用的F2是什么版本? A: Mac,chrome,0.0.1.6 - 操作系统: [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: 请你复制并粘贴出错时运行的命令和配置文件内容,以及重现该行为的步骤。如果你一次性就提供完整信息,就会节省很多解决问题的时间。 A: JundeAir:~ jun$ f2 wb -p /Users/jun/Downloads -M one -u https://weibo.com/2005144907/Os9PT4cM7 WARNING 您当前使用的版本 0.0.1.6 可能已过时,请考虑及时升级到最新版本 0.0.1.6,请使用 pip install -U f2 更新 INFO 应用:weibo INFO 模式:one INFO 主配置路径:/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/f2/conf/app.yaml INFO 自定义配置路径:/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/f2/conf/app.ya ml INFO 开始爬取微博: Os9PT4cM7 ERROR 解析 https://login.sina.com.cn/sso/login.php?url=https%3A%2F%2Fweibo.com%2Fajax%2Fstatuses%2Fshow%3Fid%3DOs9PT4cM7% 26locale%3Dzh-CN&_rand=1723710254.587&gateway=1&service=miniblog&entry=miniblog&useticket=1&returntype=META&su daref=&_client_version=0.6.33 接口 JSON 失败:'utf-8' codec can't decode byte 0xd0 in position 28: invalid continuation byte INFO 微博ID: None, 微博文案: None, 作者昵称: None, 发布时间: Invalid timestamp Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.12/bin/f2", line 8, in sys.exit(main()) ^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/f2/apps/weibo/cli.py", line 347, in weibo ctx.invoke(set_cli_config, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/f2/cli/cli_commands.py", line 182, in set_cli_config asyncio.run(run_app(kwargs)) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/f2/cli/cli_commands.py", line 190, in run_app await app_module.main(kwargs) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/f2/apps/weibo/handler.py", line 226, in main await mode_function_map[mode](WeiboHandler(kwargs)) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/f2/apps/weibo/handler.py", line 149, in handle_one_weibo user_path = await self.get_or_add_user_data(self.kwargs, weibo.user_id, db) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/f2/apps/weibo/handler.py", line 106, in get_or_add_user_data current_user_data = await self.fetch_user_info(user_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/f2/apps/weibo/handler.py", line 52, in fetch_user_info params = UserInfo(uid=uid, custom=custom) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pydantic/main.py", line 171, in __init__ self.__pydantic_validator__.validate_python(data, self_instance=self) pydantic_core._pydantic_core.ValidationError: 1 validation error for UserInfo uid Input should be a valid string [type=string_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.6/v/string_type 1. 2. 3. Q: 请添加调试命令`f2 -d DEBUG`重新运行出错的命令并提供日志目录下的日志文件。 A: Q: 如果是开发者请提供最小的代码示例 A: ```python ```

预期行为 简明扼要地描述期望发生的事情。

屏幕截图 请添加截图以帮助解释你的问题。

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

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

CCMonkeyss commented 3 months ago

后来刷新了一下cookie,one模式正常了,post模式还是不能用。