diff options
author | Jaime Marquínez Ferrándiz <[email protected]> | 2015-06-30 19:45:42 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <[email protected]> | 2015-06-30 19:50:17 +0200 |
commit | cf2ac6df6896dac4d23918867bb86fac1e1088d9 (patch) | |
tree | e70ddc44a5dafe9a1b13c1c9aacd27e51da27d71 /test/test_YoutubeDL.py | |
parent | 0130afb76e5cb6f470f39f127c8d09eea3e82d0d (diff) | |
download | youtube-dl-cf2ac6df6896dac4d23918867bb86fac1e1088d9.tar.gz youtube-dl-cf2ac6df6896dac4d23918867bb86fac1e1088d9.zip |
[YoutubeDL] format spec: Fix handling of '+' with '/'
'bestvideo+bestaudio/best' was incorrectly interpreted as 'bestvideo+(bestaudio/best)', so it would fail if 'bestaudio' doesn't exist instead of falling back to 'best'.
Diffstat (limited to 'test/test_YoutubeDL.py')
-rw-r--r-- | test/test_YoutubeDL.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py index 6f374d7ea..1e4aaa559 100644 --- a/test/test_YoutubeDL.py +++ b/test/test_YoutubeDL.py @@ -246,6 +246,14 @@ class TestFormatSelection(unittest.TestCase): self.assertEqual(downloaded['ext'], 'mp4') info_dict = _make_result(list(formats_order), extractor='youtube') + ydl = YDL({'format': 'bestvideo[height>=999999]+bestaudio/best'}) + yie = YoutubeIE(ydl) + yie._sort_formats(info_dict['formats']) + ydl.process_ie_result(info_dict) + downloaded = ydl.downloaded_info_dicts[0] + self.assertEqual(downloaded['format_id'], '38') + + info_dict = _make_result(list(formats_order), extractor='youtube') ydl = YDL({'format': '(bestvideo[ext=mp4],bestvideo[ext=webm])+bestaudio'}) yie = YoutubeIE(ydl) yie._sort_formats(info_dict['formats']) |