diff options
author | Jaime Marquínez Ferrándiz <[email protected]> | 2014-03-14 17:01:47 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <[email protected]> | 2014-03-14 17:01:47 +0100 |
commit | bc6d5978284599fdc9a3ea5cc2c3d30883a8fdc0 (patch) | |
tree | 928aef776f1f7b4686b8b201e26fdce3136af8ed /test | |
parent | aba77bbfc275440af00ab4bfe8de2733009f4bd8 (diff) | |
download | youtube-dl-bc6d5978284599fdc9a3ea5cc2c3d30883a8fdc0.tar.gz youtube-dl-bc6d5978284599fdc9a3ea5cc2c3d30883a8fdc0.zip |
Add bestvideo and worstvideo to special format names (#2163)
Diffstat (limited to 'test')
-rw-r--r-- | test/test_YoutubeDL.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py index 37e7b9b28..1f3ccaea0 100644 --- a/test/test_YoutubeDL.py +++ b/test/test_YoutubeDL.py @@ -182,6 +182,24 @@ class TestFormatSelection(unittest.TestCase): downloaded = ydl.downloaded_info_dicts[0] self.assertEqual(downloaded['format_id'], 'vid-high') + def test_format_selection_video(self): + formats = [ + {'format_id': 'dash-video-low', 'ext': 'mp4', 'preference': 1, 'acodec': 'none'}, + {'format_id': 'dash-video-high', 'ext': 'mp4', 'preference': 2, 'acodec': 'none'}, + {'format_id': 'vid', 'ext': 'mp4', 'preference': 3}, + ] + info_dict = {'formats': formats, 'extractor': 'test'} + + ydl = YDL({'format': 'bestvideo'}) + ydl.process_ie_result(info_dict.copy()) + downloaded = ydl.downloaded_info_dicts[0] + self.assertEqual(downloaded['format_id'], 'dash-video-high') + + ydl = YDL({'format': 'worstvideo'}) + ydl.process_ie_result(info_dict.copy()) + downloaded = ydl.downloaded_info_dicts[0] + self.assertEqual(downloaded['format_id'], 'dash-video-low') + def test_youtube_format_selection(self): order = [ '38', '37', '46', '22', '45', '35', '44', '18', '34', '43', '6', '5', '36', '17', '13', |