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.
Checklist
Description
Add a new format selection operator that functions like the comma, except that it requires all operands (format selectors) to be available for download.
Example (using youtube.com's formats):
If formats 248, 251 and 140 are all available, I want to merge 248+251 and download 140 as a separate audio file. Otherwise, try to download and merge 137+140.
I initially wrote this format selection:
(248+251,140)/(137+140)However, this will not work as intended because the comma operator will be valid as long as at least one format is available. So in this case, if either 248 or 251 are unavailable, and 140 is available (which it almost always is), it will only download 140 and finish, rather than skipping over to the next set of parentheses.
A new operator that works like the comma but requires all operands to be available would solve this problem. A character like a semicolon could work, which I've used for the examples below:
(248+251;140)/(137+140)If any of 248, 251 or 140 are unavailable, it would declare the entire first parenthesized selection unavailable and move on to the next one.
248+251;140If at least one format is unavailable here, youtube-dl would throw a
requested format not availableerror.(248+251);(137+140)Merge 248+251 and 137+140 as two separate video files. If at least one format is unavailable, youtube-dl would throw an error.