diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py index d994682b2..7040cd93a 100644 --- a/test/test_YoutubeDL.py +++ b/test/test_YoutubeDL.py @@ -136,6 +136,11 @@ class TestFormatSelection(unittest.TestCase): ] info_dict = _make_result(formats) + ydl = YDL({'format': ''}) # no criteria => anything goes + ydl.process_ie_result(info_dict.copy()) + downloaded = ydl.downloaded_info_dicts[0] + self.assertEqual(downloaded['format_id'], '35') + ydl = YDL({'format': '20/47'}) ydl.process_ie_result(info_dict.copy()) downloaded = ydl.downloaded_info_dicts[0] diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 6f2aba5ac..062e1fe37 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1289,6 +1289,9 @@ class YoutubeDL(object): '{0}\n\t{1}\n\t{2}^'.format(note, format_spec, ' ' * start[1])) return SyntaxError(message) + if not format_spec: + format_spec = 'worst' + PICKFIRST = 'PICKFIRST' MERGE = 'MERGE' SINGLE = 'SINGLE'