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

🐛 ZeroDivisionError: division by zero (特定视频下载出错) #257

Closed
4 tasks done
symant233 opened this issue Apr 6, 2024 · 2 comments
Closed
4 tasks done

Comments

@symant233
Copy link
Contributor

问题简述

下载视频失败

 INFO  开始下载……
Traceback (most recent call last):
  File "/home/symant/.local/bin/yutto", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/symant/.local/lib/python3.12/site-packages/yutto/__main__.py", line 59, in main
    run(args_list)
  File "/home/symant/.local/lib/python3.12/site-packages/yutto/utils/funcutils/as_sync.py", line 37, in sync_func
    return asyncio.run(async_func(*args, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 685, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/symant/.local/lib/python3.12/site-packages/yutto/__main__.py", line 328, in run
    current_download_state = await start_downloader(
                             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/symant/.local/lib/python3.12/site-packages/yutto/processor/downloader.py", line 321, in start_downloader
    await download_video_and_audio(client, video, video_path, audio, audio_path, options)
  File "/home/symant/.local/lib/python3.12/site-packages/yutto/processor/downloader.py", line 133, in download_video_and_audio
    await asyncio.gather(*coroutines)
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 684, in _wrap_awaitable
    return await awaitable
           ^^^^^^^^^^^^^^^
  File "/home/symant/.local/lib/python3.12/site-packages/yutto/utils/asynclib.py", line 27, in __await__
    return (yield from self.coro.__await__())
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/symant/.local/lib/python3.12/site-packages/yutto/processor/progressbar.py", line 79, in show_progress
    size_now / total_size,
    ~~~~~~~~~^~~~~~~~~~~~
ZeroDivisionError: division by zero

复现方式

特定视频,有的情况是直接报错,其他时候进度条卡死 显示0Bytes/s

yutto --no-danmaku --no-subtitle https://www.bilibili.com/video/BV1Wr421p7P7/

环境信息

  • OS: Windows 10 22H2, Ubuntu 20.04 focal
  • Python: 3.10.11, 3.12.2 均复现
  • yutto: 从当前最新的源码main分支构建

额外信息

No response

一点点的自我检查

  • 充分阅读 README.md,特别是与本 issue 相关的部分
  • 如果是网络问题,已经检查网络连接、设置是否正常,并经过充分测试认为这是 yutto 本身的问题
  • 本 issue 在 issuesdiscussion 中并没有重复问题
  • 确认所希望下载的资源是本人有权限获取的,yutto 不提供任何超出本人权限的资源下载方式
@symant233 symant233 changed the title 🐛 🐛 ZeroDivisionError: division by zero (特定视频下载出错) Apr 6, 2024
@SigureMo
Copy link
Member

SigureMo commented Apr 6, 2024

无法复现,提供一个开 --debug 的 log 吧

@symant233
Copy link
Contributor Author

好像是B站API不太稳定,我试又好了🤧

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