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

报错结束程序 #402

Open
245205852 opened this issue Feb 14, 2025 · 4 comments
Open

报错结束程序 #402

245205852 opened this issue Feb 14, 2025 · 4 comments

Comments

@245205852
Copy link

这个错误...... 不是固定某一个URL导致。测试结束程序前最后一个URL,单独放accounts_urls里 再下载 就不会有问题。

共获取到 1910 个账号发布作品
开始提取作品数据
昵称/标题:99;标识:2222_111111;ID:123456
Traceback (most recent call last):
File "F:\Data\TikTokDownloader\main.py", line 19, in
run(main())
File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 686, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "F:\Data\TikTokDownloader\main.py", line 10, in main
await downloader.run()
File "F:\Data\TikTokDownloader\src\application\TikTokDownloader.py", line 355, in run
await self.main_menu(safe_pop(self.run_command))
File "F:\Data\TikTokDownloader\src\application\TikTokDownloader.py", line 244, in main_menu
await self.compatible(mode)
File "F:\Data\TikTokDownloader\src\application\TikTokDownloader.py", line 324, in compatible
await self.__function_menu[n]1
File "F:\Data\TikTokDownloader\src\application\TikTokDownloader.py", line 251, in complete
await example.run(self.run_command)
File "F:\Data\TikTokDownloader\src\application\main_complete.py", line 1709, in run
await self.__function[n]1
File "F:\Data\TikTokDownloader\src\application\main_complete.py", line 232, in account_acquisition_interactive
await self.__secondary_menu(
File "F:\Data\TikTokDownloader\src\application\main_complete.py", line 260, in __secondary_menu
await function[n][1](*args, **kwargs, )
File "F:\Data\TikTokDownloader\src\application\main_complete.py", line 263, in account_detail_batch
await self.__account_detail_batch(
File "F:\Data\TikTokDownloader\src\application\main_complete.py", line 299, in __account_detail_batch
if not await self.deal_account_detail(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Data\TikTokDownloader\src\application\main_complete.py", line 445, in deal_account_detail
return await self._batch_process_detail(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Data\TikTokDownloader\src\application\main_complete.py", line 596, in batch_process_detail
data = await self.extractor.run(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Data\TikTokDownloader\src\extract\extractor.py", line 161, in run
return await self.type[type
](data, recorder, tiktok, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Data\TikTokDownloader\src\extract\extractor.py", line 187, in __batch
self.__platform_classify_detail(data, container, tiktok, )
File "F:\Data\TikTokDownloader\src\extract\extractor.py", line 816, in __platform_classify_detail
self.__extract_batch(
File "F:\Data\TikTokDownloader\src\extract\extractor.py", line 216, in __extract_batch
self.__extract_detail_info(container.cache, data)
File "F:\Data\TikTokDownloader\src\extract\extractor.py", line 308, in __extract_detail_info
self.__classifying_detail(item, data)
File "F:\Data\TikTokDownloader\src\extract\extractor.py", line 332, in __classifying_detail
self.__extract_video_info(item, data, _("视频"), )
File "F:\Data\TikTokDownloader\src\extract\extractor.py", line 436, in __extract_video_info
item["downloads"] = self.__extract_video_download(data, )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Data\TikTokDownloader\src\extract\extractor.py", line 457, in __extract_video_download
i.play_addr.data_size,
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.SimpleNamespace' object has no attribute 'data_size'

Copy link

dosubot bot commented Feb 14, 2025

The error you're encountering, AttributeError: 'types.SimpleNamespace' object has no attribute 'data_size', suggests that the SimpleNamespace object being processed in the __extract_video_download method does not have the data_size attribute. This could be due to the structure of the data being different from what the code expects.

To resolve this issue, you can take the following steps:

  1. Check Data Structure: Verify the structure of the SimpleNamespace object being passed to the __extract_video_download method. Ensure that it contains the play_addr attribute with a nested data_size attribute.

  2. Add Debugging: Add debugging statements before the line causing the error to print out the attributes of the SimpleNamespace object. This will help you understand what attributes are actually present.

    print(vars(i.play_addr))
  3. Handle Missing Attributes: Modify the code to handle cases where data_size might be missing. You can use a default value or skip processing for such entries.

  4. Review Data Source: Ensure that the data source providing the SimpleNamespace objects is correctly populating all expected attributes. If the data source has changed, you may need to update the extraction logic accordingly.

By following these steps, you should be able to identify and fix the issue causing the AttributeError.

To continue talking to Dosu, mention @dosu.


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

@JoeanAmier
Copy link
Owner

拉取最新源码使用,或者参考 构建可执行文件指南,将最新源码打包为可执行文件后下载使用!

@245205852
Copy link
Author

拉取最新源码使用,或者参考 构建可执行文件指南,将最新源码打包为可执行文件后下载使用!

就是最新,我是在PyCharm运行 出的错

@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