JuanBindez / pytubefix

Python3 library for downloading YouTube Videos.
http://pytubefix.rtfd.io/
MIT License
674 stars 95 forks source link

yt.streams.get_highest_resolution() is not able to get me the highest resolution available video #145

Closed patermars closed 3 months ago

patermars commented 3 months ago

Describe the bug I am trying to download the highest quality video available for the video but yet its just downloading a 360p or 480p video everytime even.

My code:

from pytubefix import YouTube
from pytubefix.cli import on_progress
from pytubefix.exceptions import *

try:
    url = "https://www.youtube.com/watch?v=-pSf9_MgsZ4"

    yt = YouTube(url, on_progress_callback = on_progress)
    print(yt.title)

    ys = yt.streams.get_highest_resolution()
    ys.download()
except Exception as e:
    print("Error: ",e)

To Reproduce Steps to reproduce the behavior:

  1. Try to copy-paste and run it on your machine, it would give the same result.

Expected behavior Whatever highest quality video is available should have been downloaded.

Screenshots If applicable, add screenshots to help explain your problem.

For the video in the above code link, has the highest video availability of 4k image

but still its downloading in 360p quality:

image

Desktop (please complete the following information):

felipeucelli commented 3 months ago

See this issue #128