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

程序提示错误自动退出问题 解决方法 #400

Open
245205852 opened this issue Feb 5, 2025 · 2 comments
Open

程序提示错误自动退出问题 解决方法 #400

245205852 opened this issue Feb 5, 2025 · 2 comments

Comments

@245205852
Copy link

storage_format设置为SQL,程序就会退出且报以下错
Image

如博主有几个号,你都添加到accounts_urls ,这个错误很容易触发<作品重复且重命名会失败>

不自己改代码的情况下解决方法是把storage_format设置为csv或者xlsx,出现以上错误 你可以选择结束还是继续。

name_format没成功,可能得把Data文件夹清空。就没试了。

Copy link

dosubot bot commented Feb 5, 2025

I found a similar open issue regarding the AttributeError where a 'types.SimpleNamespace' object has no attribute 'data_size'. The suggested solution is to modify the code to safely access the data_size attribute using the safe_extract method. This method provides a default value if the attribute is not present, preventing the error. You can update the code in the __extract_video_download method as follows:

bit_rate: list[tuple[int, int, int, int, int, list[str]]] = [(
    i.FPS,
    i.bit_rate,
    self.safe_extract(i.play_addr, "data_size", 0),  # Use safe_extract to avoid AttributeError
    i.play_addr.height,
    i.play_addr.width,
    i.play_addr.url_list,
) for i in bit_rate]

This change ensures that if data_size is not present in play_addr, a default value (e.g., 0) is used instead, thus preventing the AttributeError [1].

Additionally, as a workaround without modifying the code, you can set the storage_format to csv or xlsx instead of sql, as you mentioned. This should help avoid the error and allow you to choose whether to end or continue the process.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@JoeanAmier
Copy link
Owner

提供发生错误时的链接。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants