X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=inline;f=test%2Ftest_YoutubeDL.py;h=1f3ccaea0af75636664a32183dec7b9197b49151;hb=39a743fb9baa74a5eb7b1e3af5a8bf0c5f93c096;hp=37e7b9b28fd476c64dd4d7b2a371b0f9db3d32c6;hpb=65697b3bf3bf6eaeb91a34e5308a6d2239118071;p=youtube-dl 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',