Merge ce031e9d18cd8ec154a749ba5c066c8c0f7eec6b into 3eb8d22ddb8982ca4fb56bb7a8d6517538bf14c6

This commit is contained in:
M.K. 2025-04-01 07:58:47 +02:00 committed by GitHub
commit b6b79c3261
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)
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]

View File

@ -1309,6 +1309,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'