I am trying to make a code to download videos from YouTube using pafy
module and a progressbar using tqdm
module, however the progressbar is finished before the download complete.
here is my code download piece:
with tqdm.tqdm(desc=video_name, total=video_size, unit_scale=True, unit='B', initial=0) as pbar:
bestVideo.download(filepath=full_path, quiet=True, callback=lambda _, received, *args: pbar.update(received))
here is a pic a the progressbar:
video_size
? Is it correct value - do you get downloaded file with the same size?video_size
correctly and the downloaded file is working when downloading complete, the only probleme is the progressbar finishes before download complete