Is there a way to add progress bar in pytube? I don\'t know how to use the following method:
pytube.Stream().on_progress(chunk, file_handler, bytes_remaining
I know this is already answered, but i came across this and for me the progress was counting down from 100 to 0. Since I wanted to fill a progress bar with the percentage value, I couldn't use this.
So i came up with this solution:
def progress_func(self, stream, chunk, file_handle,bytes_remaining):
size = self.video.filesize
progress = (float(abs(bytes_remaining-size)/size))*float(100)
self.loadbar.setValue(progress)
The loadbar is my Progress Bar from PyQt5. Hope this helps someone.