A feature-rich command-line audio/video downloader
[YoutubeDL] format spec: fix handling of '/' with ','
Jaime Marquínez Ferrándizf5f4a27a964b
diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.pyindex 1e4aaa5594..f103779d37 100644--- a/test/test_YoutubeDL.py+++ b/test/test_YoutubeDL.py@@ -253,6 +253,14 @@ class TestFormatSelection(unittest.TestCase):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/best,bestaudio'})+ yie = YoutubeIE(ydl)+ yie._sort_formats(info_dict['formats'])+ ydl.process_ie_result(info_dict)+ downloaded_ids = [info['format_id'] for info in ydl.downloaded_info_dicts]+ self.assertEqual(downloaded_ids, ['137', '141'])+info_dict = _make_result(list(formats_order), extractor='youtube')ydl = YDL({'format': '(bestvideo[ext=mp4],bestvideo[ext=webm])+bestaudio'})yie = YoutubeIE(ydl)diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.pyindex 5deb4848e8..5a79e5f1d1 100755--- a/youtube_dl/YoutubeDL.py+++ b/youtube_dl/YoutubeDL.py@@ -958,8 +958,7 @@ class YoutubeDL(object):elif string == '/':first_choice = current_selectorsecond_choice = _parse_format_selection(tokens, inside_choice=True)- current_selector = None- selectors.append(FormatSelector(PICKFIRST, (first_choice, second_choice), []))+ current_selector = FormatSelector(PICKFIRST, (first_choice, second_choice), [])elif string == '[':if not current_selector:current_selector = FormatSelector(SINGLE, 'best', [])