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.
[Feature Request] Add more operations to format selection #19241
Comments
|
At the moment it is not possible to request the smallestFilesize. You could use worstvideo+worstaudio as a workaround. I don't know if it is the same as the smallest sum of (smallestVideo+smallestAudio). I get the best video without any format option (248) for the video mentioned above. Why don't you just use -f bestvideo+bestaudio? |
|
Could not get 137+140 with the option "bestvideo+bestaudio"..
|
|
You are right. I checked for "best" and not for bestvideo. I guess bestvideo uses the highest videobitrate which results in 136 with lower resolution, like you wrote. youtube-dl --get-url -f "bestvideo[height>1000],bestaudio" "https://www.youtube.com/watch?v=XiVeuftm5go&t=4s" # is a workaround |
A smallest file size operator would hopefully get 136+140 instead. |

What is the purpose of your issue?
Enhancement of Format Selection
Format selection now allow the best/worst format to download. However, the format selection only support conditions (e.g.
-f "best[height>=720]"), as a filter. In some special case, people may want to download video of most/least certain field (e.g. highest resolution, smallest size) rather than default "best/worst". Youtube-dl does not support this without manually specify numeric format code or knowing the exact value.For example, the
bestquality for this youtube video is a medium(640x360) resolution while highest resolution is 1080p(1920x1080).If I want to download the highest resolution of this video, I had to manually specify 1080p or an extractor specific code(137, 248) now.
Requested new feature: add more operations of format selection.
Sample: To find highest resolution, use
-f "best[height]"or-f "best[height=max]"