how to speed up downloading video with pytube library?

51 views Asked by At

I'm using pytube libry for downloading youtube videos by resolution. If I download vieos which is have 360 and 720 reslution it is ok. downloading good but other resolution downloading is so slow and takes long time. How to speed up with other videos resolution? her is my code:

from pytube import YouTube
from pprint import pprint


yt = YouTube("https://youtu.be/s0dMTAQM4cw?si=eFNtZfCMVb8jjkPi", use_oauth = True)

# this strime downloading is fast
for formatt in yt.streaming_data['formats']:
    if formatt.get('qualityLabel') == '720p':
    pprint(formatt)
        

# this stream downloading is so slow
for formatt in yt.streaming_data['adaptiveFormats']:
    if formatt.get('qualityLabel') == '1080p':
        pprint(formatt)

I need download lik 144p, 480p and 1080p resolution videos faster.

0

There are 0 answers