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

New format selection operator that requires all operands to be available #26418

Open
3 tasks done
osyu opened this issue Aug 23, 2020 · 0 comments
Open
3 tasks done

New format selection operator that requires all operands to be available #26418

osyu opened this issue Aug 23, 2020 · 0 comments
Labels

Comments

@osyu
Copy link

osyu commented Aug 23, 2020

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2020.07.28
  • I've searched the bugtracker for similar feature requests including closed ones

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):

ID Format
137 (video) H.264 1080p
140 (audio) AAC 128k
248 (video) VP9 1080p
251 (audio) Opus 160k

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;140
If at least one format is unavailable here, youtube-dl would throw a requested format not available error.

(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.

@osyu osyu added the request label Aug 23, 2020
@osyu osyu changed the title New format selection operator that requires both operands to be available New format selection operator that requires all operands to be available Aug 23, 2020
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

1 participant