Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Need option to prioritize different conditions #10506
Comments
|
Provide concrete example. |
|
“youtube-dl https://www.youtube.com/watch?v=sLprVF6d7Ug https://www.youtube.com/watch?v=sLprVF6d7Ug -f bestvideo” gives an 8K WebM video. “youtube-dl https://www.youtube.com/watch?v=IJhgZBn-LHg https://www.youtube.com/watch?v=IJhgZBn-LHg -f bestvideo” gives a 4K WebM video. I want to have youtube-dl get me the 8K WebM video from the first link and the 4K MP4 video from the second link. |
|
What about
|
|
That’s my current solution. That may not work with other sites, however, and it is a rather makeshift solution anyway. |
|
If this isn't clear, my issue is that the solution mentioned above works on the assumption that MP4s are available up to 4K, and not available above that. This may only be true for YouTube, and may not apply to other extractors or even YouTube itself in the future. I feel it is preferable to actually specify what I desire in the config, rather than specifying a series of requirements that just HAPPEN to do what I want right now. This is a broadly applicable improvement, too, and unless I am mistaken is easy to implement. I'd do it myself if I had the time to work out how GitHub commits work right now. |
Please follow the guide below
xinto all the boxes [ ] relevant to your issue (like that [x])Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2016.08.31. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue
If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add
-vflag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):
Description of your issue, suggested solution and other information
I would like to be able to automatically get the best possible file, regardless of format, but still prefer a format if the highest quality is available in it. At the moment, this isn’t really possible.
On YouTube, for instance, MP4s are not available in 8K. WebM is, so the behavior I’d like is to download that. However, this will only occur if I do not specify a preferred format at all, using “bestvideo". If I add that argument to my config file, I won’t download MP4 even when it is available at the highest quality. Even if I immediately convert it to MP4 using ffmpeg, this wastes power and time needlessly.
The alternate approach, of course, is to use “bestvideo[ext=mp4]”. This will download the best available MP4 file, which is ultimately what I want in most cases. However, using such an argument with the aforementioned 8K video will result in a 4K MP4, as YouTube does not provide higher resolutions in that format.
Right now, there is a way to prioritize a chosen format and choose the best from it. I believe there should be the opposite as well: prioritize the best quality, and choose a format from that if available. That means it would always download the best, preferring a given format but choosing another one if it isn’t available.