mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-06-27 17:08:32 +00:00
Merge 3def427d24
into 06c1a8cdff
This commit is contained in:
commit
c7f34c313f
@ -2194,7 +2194,7 @@ def _filter(f):
|
|||||||
return op(actual_value, comparison_value)
|
return op(actual_value, comparison_value)
|
||||||
return _filter
|
return _filter
|
||||||
|
|
||||||
def _check_formats(self, formats):
|
def _check_formats(self, formats, warning=True):
|
||||||
for f in formats:
|
for f in formats:
|
||||||
working = f.get('__working')
|
working = f.get('__working')
|
||||||
if working is not None:
|
if working is not None:
|
||||||
@ -2222,7 +2222,11 @@ def _check_formats(self, formats):
|
|||||||
f.pop('__needs_testing', None)
|
f.pop('__needs_testing', None)
|
||||||
yield f
|
yield f
|
||||||
else:
|
else:
|
||||||
self.to_screen('[info] Unable to download format {}. Skipping...'.format(f['format_id']))
|
msg = f'Unable to download format {f["format_id"]}. Skipping...'
|
||||||
|
if warning:
|
||||||
|
self.report_warning(msg)
|
||||||
|
else:
|
||||||
|
self.to_screen(f'[info] {msg}')
|
||||||
|
|
||||||
def _select_formats(self, formats, selector):
|
def _select_formats(self, formats, selector):
|
||||||
return list(selector({
|
return list(selector({
|
||||||
@ -2948,7 +2952,7 @@ def is_wellformed(f):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if self.params.get('check_formats') is True:
|
if self.params.get('check_formats') is True:
|
||||||
formats = LazyList(self._check_formats(formats[::-1]), reverse=True)
|
formats = LazyList(self._check_formats(formats[::-1], warning=False), reverse=True)
|
||||||
|
|
||||||
if not formats or formats[0] is not info_dict:
|
if not formats or formats[0] is not info_dict:
|
||||||
# only set the 'formats' fields if the original info_dict list them
|
# only set the 'formats' fields if the original info_dict list them
|
||||||
|
Loading…
Reference in New Issue
Block a user