Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]今天下午突然报错 #102

Open
2 of 4 tasks
zhiben5201 opened this issue Jun 27, 2024 · 6 comments
Open
2 of 4 tasks

[BUG]今天下午突然报错 #102

zhiben5201 opened this issue Jun 27, 2024 · 6 comments
Labels
故障(bug) 代码问题导致的错误(Bugs caused by code problems) 已确认(confirmed) 该issue已被处理,将在下次推送中更新(The issue has been processed and will be updated in the next push)

Comments

@zhiben5201
Copy link

zhiben5201 commented Jun 27, 2024

  • 我查看了 文档 以及 已关闭的问题 以寻找可能的解决方案。
  • 我在 常见的问题与解决办法 中找不到我的问题。
  • 你的问题是公开的,请注意删除个人敏感内容再上传
  • 不按照模板填写的问题将不会得到优先的处理。

INFO App: douyin
INFO 主配置路径:F:\douyin4\venv\lib\site-packages\f2\conf\app.yaml
INFO 自定义配置路径:F:\douyin4\venv\lib\site-packages\f2\conf\app.yaml
INFO Version 0.0.1.5
INFO 开始爬取用户:MS4wLjABAAAAwiqMUr1NyBcwRFIwFfxUwcX9IJq2sYGqbOTtYTlifng-8
Z9Yk_Tgeev21XVFLlIc 发布的作品
INFO 开始爬取第 0 页

Traceback (most recent call last):
File "C:\Users\15920\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\15920\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "F:\douyin4\venv\Scripts\f2.exe_main
.py", line 7, in
sys.exit(main())
File "F:\douyin4\venv\lib\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
File "F:\douyin4\venv\lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
File "F:\douyin4\venv\lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "F:\douyin4\venv\lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "F:\douyin4\venv\lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "F:\douyin4\venv\lib\site-packages\click\decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "F:\douyin4\venv\lib\site-packages\f2\apps\douyin\cli.py", line 443, in douyin
ctx.invoke(set_cli_config, **kwargs)
File "F:\douyin4\venv\lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "F:\douyin4\venv\lib\site-packages\click\decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "F:\douyin4\venv\lib\site-packages\f2\cli\cli_commands.py", line 135, in set_cli_config
asyncio.run(run_app(kwargs))
File "C:\Users\15920\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\15920\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
return future.result()
File "F:\douyin4\venv\lib\site-packages\f2\cli\cli_commands.py", line 144, in run_app
await app_module.main(kwargs)
File "F:\douyin4\venv\lib\site-packages\f2\apps\douyin\handler.py", line 1484, in main
await mode_function_mapmode
File "F:\douyin4\venv\lib\site-packages\f2\apps\douyin\handler.py", line 264, in handle_user_post
self.kwargs, aweme_data_list._to_list(), user_path
File "F:\douyin4\venv\lib\site-packages\f2\apps\douyin\filter.py", line 345, in _to_list
attr_values = getattr(self, key)
File "F:\douyin4\venv\lib\site-packages\f2\apps\douyin\filter.py", line 243, in video_bit_rate
return [
File "F:\douyin4\venv\lib\site-packages\f2\apps\douyin\filter.py", line 249, in
if len(aweme) == 1
TypeError: object of type 'NoneType' has no len()

详细描述错误
已经尝试包括更换COOKIE,重启路由器,重新安装最新版PY F2等操作,故障依旧存在

系统平台

Q:你在哪个平台(Win/Linux/Mac)上运行?你使用的是什么浏览器?你使用的是什么终端软件?你使用的F2是什么版本?

A: WIN10 X64 EDGE浏览器,F2最新版 WT

@zhiben5201 zhiben5201 added the 故障(bug) 代码问题导致的错误(Bugs caused by code problems) label Jun 27, 2024
@Mak0760
Copy link

Mak0760 commented Jun 27, 2024

same,问题也复现在我这里

@zhiben5201
Copy link
Author

same,问题也复现在我这里

我试了下过去的EXE版本,是可以用的,所以应该是PY F2这边出现了什么问题,搜了一下实在不懂只能等了

@EsperantoP
Copy link

怀疑是不是抖音服务器更新了什么检测系统这大家都不能用了啊?
image

@Johnserf-Seed
Copy link
Owner

怀疑是不是抖音服务器更新了什么检测系统这大家都不能用了啊? image

问题原因

抖音的作品接口更新了视频里的比特率列表,0.0.1.6版明天推送,也可以手动修改这部分代码。

手动修复

  • f2/apps/douyin/filter.py 下搜索video_bit_rate,将2段旧代码都替换为下面的代码。

f2/apps/douyin/filter.py:245

    # 修复前
    @property
    def video_bit_rate(self):
        bit_rate_data = self._get_list_attr_value("$.aweme_list[*].video.bit_rate")

        return [
            (
                [aweme["bit_rate"]]
                if isinstance(aweme, dict)
                else (
                    [aweme[0]["bit_rate"]]
                    if len(aweme) == 1
                    else [item["bit_rate"] for item in aweme]
                )
            )
            for aweme in bit_rate_data
        ]

    # 修复后
    @property
    def video_bit_rate(self):
        bit_rate_data = self._get_list_attr_value("$.aweme_list[*].video.bit_rate")

        def extract_bit_rate(aweme):
            if not aweme:
                return []

            if isinstance(aweme, dict):
                return [aweme.get("bit_rate", 0)]

            if isinstance(aweme, list):
                return [item.get("bit_rate", 0) for item in aweme]

            return []

        return [extract_bit_rate(aweme) for aweme in bit_rate_data]

f2/apps/douyin/filter.py:1391

    # 修复前
    @property
    def video_bit_rate(self):
        bit_rate_data = self._get_list_attr_value(
            "$.aweme_detail.video.bit_rate",
        )

        return [
            (
                [aweme["bit_rate"]]
                if isinstance(aweme, dict)
                else (
                    [aweme[0]["bit_rate"]]
                    if len(aweme) == 1
                    else [item["bit_rate"] for item in aweme]
                )
            )
            for aweme in bit_rate_data
        ]


    # 修复后
    @property
    def video_bit_rate(self):
        bit_rate_data = self._get_list_attr_value("$.aweme_detail.video.bit_rate")

        def extract_bit_rate(aweme):
            if not aweme:
                return []

            if isinstance(aweme, dict):
                return [aweme.get("bit_rate", 0)]

            if isinstance(aweme, list):
                return [item.get("bit_rate", 0) for item in aweme]

            return []

        return [extract_bit_rate(aweme) for aweme in bit_rate_data]

@EsperantoP
Copy link

怀疑是不是抖音服务器更新了什么检测系统这大家都不能用了啊? image

问题原因

抖音的作品接口更新了视频里的比特率列表,0.0.1.6版明天推送,也可以手动修改这部分代码。

手动修复

  • f2/apps/douyin/filter.py 下搜索video_bit_rate,将2段旧代码都替换为下面的代码。

f2/apps/douyin/filter.py:245

    # 修复前
    @property
    def video_bit_rate(self):
        bit_rate_data = self._get_list_attr_value("$.aweme_list[*].video.bit_rate")

        return [
            (
                [aweme["bit_rate"]]
                if isinstance(aweme, dict)
                else (
                    [aweme[0]["bit_rate"]]
                    if len(aweme) == 1
                    else [item["bit_rate"] for item in aweme]
                )
            )
            for aweme in bit_rate_data
        ]

    # 修复后
    @property
    def video_bit_rate(self):
        bit_rate_data = self._get_list_attr_value("$.aweme_list[*].video.bit_rate")

        def extract_bit_rate(aweme):
            if not aweme:
                return []

            if isinstance(aweme, dict):
                return [aweme.get("bit_rate", 0)]

            if isinstance(aweme, list):
                return [item.get("bit_rate", 0) for item in aweme]

            return []

        return [extract_bit_rate(aweme) for aweme in bit_rate_data]

f2/apps/douyin/filter.py:1391

    # 修复前
    @property
    def video_bit_rate(self):
        bit_rate_data = self._get_list_attr_value(
            "$.aweme_detail.video.bit_rate",
        )

        return [
            (
                [aweme["bit_rate"]]
                if isinstance(aweme, dict)
                else (
                    [aweme[0]["bit_rate"]]
                    if len(aweme) == 1
                    else [item["bit_rate"] for item in aweme]
                )
            )
            for aweme in bit_rate_data
        ]


    # 修复后
    @property
    def video_bit_rate(self):
        bit_rate_data = self._get_list_attr_value("$.aweme_detail.video.bit_rate")

        def extract_bit_rate(aweme):
            if not aweme:
                return []

            if isinstance(aweme, dict):
                return [aweme.get("bit_rate", 0)]

            if isinstance(aweme, list):
                return [item.get("bit_rate", 0) for item in aweme]

            return []

        return [extract_bit_rate(aweme) for aweme in bit_rate_data]

非常感谢!!!请问这个commit 原本应该是更新代码文件的是嘛?:3

@zhiben5201
Copy link
Author

怀疑是不是抖音服务器更新了什么检测系统这大家都不能用了啊? image

问题原因

抖音的作品接口更新了视频里的比特率列表,0.0.1.6版明天推送,也可以手动修改这部分代码。

手动修复

  • f2/apps/douyin/filter.py 下搜索video_bit_rate,将2段旧代码都替换为下面的代码。

f2/apps/douyin/filter.py:245

    # 修复前
    @property
    def video_bit_rate(self):
        bit_rate_data = self._get_list_attr_value("$.aweme_list[*].video.bit_rate")

        return [
            (
                [aweme["bit_rate"]]
                if isinstance(aweme, dict)
                else (
                    [aweme[0]["bit_rate"]]
                    if len(aweme) == 1
                    else [item["bit_rate"] for item in aweme]
                )
            )
            for aweme in bit_rate_data
        ]

    # 修复后
    @property
    def video_bit_rate(self):
        bit_rate_data = self._get_list_attr_value("$.aweme_list[*].video.bit_rate")

        def extract_bit_rate(aweme):
            if not aweme:
                return []

            if isinstance(aweme, dict):
                return [aweme.get("bit_rate", 0)]

            if isinstance(aweme, list):
                return [item.get("bit_rate", 0) for item in aweme]

            return []

        return [extract_bit_rate(aweme) for aweme in bit_rate_data]

f2/apps/douyin/filter.py:1391

    # 修复前
    @property
    def video_bit_rate(self):
        bit_rate_data = self._get_list_attr_value(
            "$.aweme_detail.video.bit_rate",
        )

        return [
            (
                [aweme["bit_rate"]]
                if isinstance(aweme, dict)
                else (
                    [aweme[0]["bit_rate"]]
                    if len(aweme) == 1
                    else [item["bit_rate"] for item in aweme]
                )
            )
            for aweme in bit_rate_data
        ]


    # 修复后
    @property
    def video_bit_rate(self):
        bit_rate_data = self._get_list_attr_value("$.aweme_detail.video.bit_rate")

        def extract_bit_rate(aweme):
            if not aweme:
                return []

            if isinstance(aweme, dict):
                return [aweme.get("bit_rate", 0)]

            if isinstance(aweme, list):
                return [item.get("bit_rate", 0) for item in aweme]

            return []

        return [extract_bit_rate(aweme) for aweme in bit_rate_data]

非常感谢,已经手动修改成功

@Johnserf-Seed Johnserf-Seed added the 已确认(confirmed) 该issue已被处理,将在下次推送中更新(The issue has been processed and will be updated in the next push) label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
故障(bug) 代码问题导致的错误(Bugs caused by code problems) 已确认(confirmed) 该issue已被处理,将在下次推送中更新(The issue has been processed and will be updated in the next push)
Projects
None yet
Development

No branches or pull requests

4 participants