H
H
HyperChan2022-03-18 19:52:07
YouTube
HyperChan, 2022-03-18 19:52:07

Progressbar not working in pytube?

Progressbar not working. appears only after the video is loaded.

import datetime
from pytube import YouTube
from pytube.cli import on_progress
def download_video(self, url, quality):
        yt = YouTube(url, on_progress_callback=on_progress)
        print("Video title: " + yt.title)
        print("Video views: " + str(yt.views))
        print("Video length: " + str(datetime.timedelta(seconds=yt.length)))
        print("Starting Download! \n")
        yt.streams.filter(res=quality, file_extension='mp4').first().download("Downloaded Videos")
        print("\n")
        print("Download Finished")

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question