1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2025-07-04 17:36:20 +00:00

Merge ce031e9d18cd8ec154a749ba5c066c8c0f7eec6b into 711e72c292327674c4a0593fdbb83d6347738ec9

This commit is contained in:
M.K. 2025-02-08 03:56:59 +08:00 committed by GitHub
commit 5c049f6ccd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -136,6 +136,11 @@ class TestFormatSelection(unittest.TestCase):
] ]
info_dict = _make_result(formats) 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 = YDL({'format': '20/47'})
ydl.process_ie_result(info_dict.copy()) ydl.process_ie_result(info_dict.copy())
downloaded = ydl.downloaded_info_dicts[0] downloaded = ydl.downloaded_info_dicts[0]

View File

@ -1309,6 +1309,9 @@ class YoutubeDL(object):
'{0}\n\t{1}\n\t{2}^'.format(note, format_spec, ' ' * start[1])) '{0}\n\t{1}\n\t{2}^'.format(note, format_spec, ' ' * start[1]))
return SyntaxError(message) return SyntaxError(message)
if not format_spec:
format_spec = 'worst'
PICKFIRST = 'PICKFIRST' PICKFIRST = 'PICKFIRST'
MERGE = 'MERGE' MERGE = 'MERGE'
SINGLE = 'SINGLE' SINGLE = 'SINGLE'