I am implementing a youtube video downloader using pytube3. In the following progress_bar()
function I am getting an positional argument
missing error.
My progress_bar() function:
def progress_bar(stream, chunk, file_handle, bytes_remaining):
file_downloaded = file_size - bytes_remaining
percentage = (file_downloaded / file_size) * 100
print(f'{percentage :00.0f}% done...')
My YouTube() object:
yt_object = YouTube(url, on_progress_callback=progress_bar)
I am getting the following error while displaying or printing the progress
progress_bar() missing 1 required positional argument: 'bytes_remaining'
The file is being downloaded successfully if I do remove the progress_bar reference in YouTube object i.e. yt_object, but I am facing the error in implementing progress_bar().