{"action":"created","issue":{"url":"https://api.github.com/repos/rg3/youtube-dl/issues/7522","labels_url":"https://api.github.com/repos/rg3/youtube-dl/issues/7522/labels{/name}","comments_url":"https://api.github.com/repos/rg3/youtube-dl/issues/7522/comments","events_url":"https://api.github.com/repos/rg3/youtube-dl/issues/7522/events","html_url":"https://github.com/rg3/youtube-dl/issues/7522","id":117201609,"number":7522,"title":"Optional filter specification for \"ext\" doesn't work","user":{"login":"realnc","id":1665903,"avatar_url":"https://avatars.githubusercontent.com/u/1665903?v=3","gravatar_id":"","url":"https://api.github.com/users/realnc","html_url":"https://github.com/realnc","followers_url":"https://api.github.com/users/realnc/followers","following_url":"https://api.github.com/users/realnc/following{/other_user}","gists_url":"https://api.github.com/users/realnc/gists{/gist_id}","starred_url":"https://api.github.com/users/realnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realnc/subscriptions","organizations_url":"https://api.github.com/users/realnc/orgs","repos_url":"https://api.github.com/users/realnc/repos","events_url":"https://api.github.com/users/realnc/events{/privacy}","received_events_url":"https://api.github.com/users/realnc/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-16T19:39:38Z","updated_at":"2015-11-16T21:41:14Z","closed_at":"2015-11-16T20:04:49Z","body":"Videos that are provided only in \"mp4\" by YouTube break youtube-dl when using a filter specification such as:\r\n\r\n    $ youtube-dl -f 'bestvideo[ext=?webm]+bestaudio' -g https://www.youtube.com/watch?v=1UE2x2OcfxI\r\n    ERROR: requested format not available\r\n\r\nI have `[ext=?webm]` stored as a default option, so that WebM is preferred, but if it doesn't exist (like in the video given in the example above), then H.264 video is OK. The point is that WebM should be preferred if both are available, but it shouldn't fail if WebM is not available, since the filter operator is `=?`, not just `=`.\r\n\r\nIn case it matters, the same thing happens with audio. Same error message if I try `bestvideo+bestaudio[ext=?webm]`.\r\n\r\nA workaround exists, but it can get rather long. For example, this doesn't work:\r\n\r\n    bestvideo[ext=?webm]+bestaudio[ext=?webm]\r\n\r\nBut the longer equivalent does work:\r\n\r\n    bestvideo[ext=webm]+bestaudio[ext=webm]/bestvideo[ext=mp4]+bestaudio[ext=webm]/bestvideo[ext=mp4]+bestaudio[ext=mp4]/bestvideo[ext=webm]+bestaudio[ext=mp4]\r\n\r\n(The reason I prefer webm is because YouTube's H.264 encodes are lower quality compared to their VP9 encodes, even though the former has a higher bitrate compared to the latter.)"},"comment":{"url":"https://api.github.com/repos/rg3/youtube-dl/issues/comments/157179315","html_url":"https://github.com/rg3/youtube-dl/issues/7522#issuecomment-157179315","issue_url":"https://api.github.com/repos/rg3/youtube-dl/issues/7522","id":157179315,"user":{"login":"realnc","id":1665903,"avatar_url":"https://avatars.githubusercontent.com/u/1665903?v=3","gravatar_id":"","url":"https://api.github.com/users/realnc","html_url":"https://github.com/realnc","followers_url":"https://api.github.com/users/realnc/followers","following_url":"https://api.github.com/users/realnc/following{/other_user}","gists_url":"https://api.github.com/users/realnc/gists{/gist_id}","starred_url":"https://api.github.com/users/realnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realnc/subscriptions","organizations_url":"https://api.github.com/users/realnc/orgs","repos_url":"https://api.github.com/users/realnc/repos","events_url":"https://api.github.com/users/realnc/events{/privacy}","received_events_url":"https://api.github.com/users/realnc/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T21:41:14Z","updated_at":"2015-11-16T21:41:14Z","body":"Oh. Is that useful though? Shouldn't it mean \"webm, and if that's not available, then whatever you would have picked instead.\""}}