python-20 / video-downloader

A python application to download videos
GNU General Public License v3.0
10 stars 10 forks source link

Download progress broke with new pytube3 version 9.6.4 #75

Closed cherylli closed 4 years ago

cherylli commented 4 years ago

They changed something with the callback, please see readme under callbacks

Error:
core.py:183: DeprecationWarning: Call to deprecated function all (This object can be treated as a list, all() is useless).
  return self.yt.streams.filter(progressive=True).all()
INFO - itag of quality selected is 18
Traceback (most recent call last):
  File "youtubedl\gui.py", line 150, in download_button
    self.ytube.download(location=self.user_directory, itag=itag)
  File "core.py", line 206, in download
    stream.download(output_path=location, filename=video_filename)
  File "env\lib\site-packages\pytube\streams.py", line 241, in download
    self.on_progress(chunk, fh, bytes_remaining)
  File "env\lib\site-packages\pytube\streams.py", line 302, in on_progress
    self._monostate.on_progress(self, chunk, bytes_remaining)
  File "gui.py", line 174, in download_progress       
    round((1 - bytes_remaining / file_size) * 100, 3))
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

apparently bytes_Remaining is returning none now and .all() is deprecated

cherylli commented 4 years ago

https://github.com/get-pytube/pytube3/blob/aba400f31fab43c9921d0e1d6bb8045aced80c81/pytube/monostate.py

chonix commented 4 years ago

PR #76

chonix commented 4 years ago

PR Merged!

faijan22 commented 4 years ago

same error can someone help please help me

ERROR:-

videos = yt.streams.all() DeprecationWarning: Call to deprecated function all (This object can be treated as a list, all() is useless).

cherylli commented 4 years ago

same error can someone help please help me

ERROR:-

videos = yt.streams.all() DeprecationWarning: Call to deprecated function all (This object can be treated as a list, all() is useless).

https://github.com/python-20/video-downloader/pull/76/files

cineebay commented 4 years ago

just simply remove .all() in the end