mps-youtube / yewtube

yewtube, forked from mps-youtube , is a Terminal based YouTube player and downloader. No Youtube API key required.
GNU General Public License v3.0
8.12k stars 642 forks source link

Division By Zero in downloading of playlist #620

Closed Zarthus closed 6 years ago

Zarthus commented 7 years ago
Download Queue (video):

 1   Nerd? Completes... Just Cause 3 - 19 - Eye Of The Storm                                                    30:46
 2   Nerd? Completes... Just Cause 3 - 20 - God Of Thunder                                                      21:13
 3   Nerd? Completes... Just Cause 3 - 21 - The Immortal Tank                                                   25:54
 4   Nerd? Completes... Just Cause 3 - 22 - Debt                                                                30:07
 5   Nerd? Completes... Just Cause 3 - 23 - Contrabandero                                                       28:36
 6   Nerd? Completes... Just Cause 3 - 24 - Touching Base                                                       27:30

Saved to Nerd? Completes... Just Cause 3 - 18 - Under The Siege
Downloading to D:\Zarthus\Downloads\Nerd_ Completes... Just Cause 3\Nerd_ Completes... Just Cause 3 - 19 - Eye Of The Storm.mp4 ..
Traceback (most recent call last):
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Zarthus\AppData\Local\Programs\Python\Python35-32\Scripts\mpsyt.exe\__main__.py", line 9, in <module>
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\site-packages\mps_youtube\main.py", line 141, in main
    if matchfunction(i.function, i.regex, userinput):
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\site-packages\mps_youtube\main.py", line 64, in matchfunction
    func(*matches)
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\site-packages\mps_youtube\commands\download.py", line 25, in download
    down_plist(dltype, plid)
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\site-packages\mps_youtube\commands\download.py", line 199, in down_plist
    down_many(dltype, "1-", subdir=subdir)
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\site-packages\mps_youtube\commands\download.py", line 170, in down_many
    _download(song, filename, url=None, audio=av == "audio")
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\site-packages\mps_youtube\commands\download.py", line 378, in _download
    rate = (bytesdone / 1024) / elapsed
ZeroDivisionError: float division by zero
C:\Windows\System32>mpsyt -v
mpsyt version      : 0.2.7.1
   notes           : released 6 July 2016
pafy version       : 0.5.3.1 (youtube-dl backend)
youtube-dl version : 2017.04.17
Python version     : 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)]
Processor          : Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
Machine type       : AMD64
Architecture       : 32bit, WindowsPE
Platform           : Windows-10-10.0.14393-SP0
sys.stdout.enc     : cp437
default enc        : utf-8
Config dir         : C:\Users\Zarthus\AppData\Roaming\mps-youtube

For this playlist on Episode 19

Zarthus commented 7 years ago

This has happened again during the downloading of Tom Scott's "Things You Might Not Know" playlist,

Download Queue (video):

 1   Why Does Nighttime Smartphone Footage Look All Flickery in Europe?                                         02:46
 2   The Underground Roundabouts of Troms?                                                                      01:10
 3   The 134-Hour Television Show from the Arctic Circle                                                        02:05
 4   The Secret Pattern That Stops You Copying Bank Notes                                                       01:31
 5   How To Make An Orange Peel Flamethrower                                                                    01:52
 6   Why Aren't There More Helicopter Crashes In London?                                                        02:11
 7   There Are Special Crossings For Horses In Britain                                                          01:24

Saved to The Thames Still Has Some 19th Century Stink In It
Downloading to D:\Zarthus\Downloads\Things You Might Not Know\Why Does Nighttime Smartphone Footage Look All Flickery in Europe_.mp4 ..
Traceback (most recent call last):
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Zarthus\AppData\Local\Programs\Python\Python35-32\Scripts\mpsyt.exe\__main__.py", line 9, in <module>
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\site-packages\mps_youtube\main.py", line 141, in main
    if matchfunction(i.function, i.regex, userinput):
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\site-packages\mps_youtube\main.py", line 64, in matchfunction
    func(*matches)
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\site-packages\mps_youtube\commands\download.py", line 25, in download
    down_plist(dltype, plid)
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\site-packages\mps_youtube\commands\download.py", line 199, in down_plist
    down_many(dltype, "1-", subdir=subdir)
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\site-packages\mps_youtube\commands\download.py", line 170, in down_many
    _download(song, filename, url=None, audio=av == "audio")
  File "c:\users\zarthus\appdata\local\programs\python\python35-32\lib\site-packages\mps_youtube\commands\download.py", line 378, in _download
    rate = (bytesdone / 1024) / elapsed
ZeroDivisionError: float division by zero

To provide information on which commands I ran:

userpl enyay
dv 8

It seems mostly timing related though

ids1024 commented 7 years ago

Thanks for reporting this. https://github.com/mps-youtube/mps-youtube/commit/bdea35d50f50fd0eaef036d9c7d762068df1f192 Should fix it.