Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Not finding the best resolution #1896

Open
Phanttan opened this issue Mar 15, 2024 · 2 comments
Open

[BUG] Not finding the best resolution #1896

Phanttan opened this issue Mar 15, 2024 · 2 comments
Labels

Comments

@Phanttan
Copy link

I cannot find out the best resolution in video.
Example we can try to sample URL in README.

When we see in Youtube, the best resolution is 1080p
image

But in code, I am only seeing the best resolution is 720p.
I am using pytub the lasted version 15 and tried both DASH and Progressive Stream.

Thank you!

@Phanttan Phanttan added the bug label Mar 15, 2024
Copy link

Thank you for contributing to PyTube. Please remember to reference Contributing.md

@jaykim97
Copy link

jaykim97 commented Apr 5, 2024

@Phanttan
Looked into this issue. It seems all the videos with resolution higher than 720p are progressive=False.

you can try to get the higest resolution video.

yt.streams.filter(adaptive=True).order_by("resolution").last()
or 
yt.streams.filter(progressive=False).order_by("resolution").last()

you can also include mime_type="video/mp4" to get the mp4 format to match the result of get_highest_resolution().

However, This will result in video only stream so if you are trying to download both video and audio, you'll need to use something like ffmpeg to download both audio and video and merge to a single mp4 file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants