|
|
|
@ -1139,8 +1139,7 @@ class YoutubeDL(object):
|
|
|
|
|
res = default
|
|
|
|
|
return res
|
|
|
|
|
|
|
|
|
|
def list_formats(self, info_dict):
|
|
|
|
|
def format_note(fdict):
|
|
|
|
|
def _format_note(self, fdict):
|
|
|
|
|
res = ''
|
|
|
|
|
if fdict.get('ext') in ['f4f', 'f4m']:
|
|
|
|
|
res += '(unsupported) '
|
|
|
|
@ -1184,12 +1183,13 @@ class YoutubeDL(object):
|
|
|
|
|
res += format_bytes(fdict['filesize'])
|
|
|
|
|
return res
|
|
|
|
|
|
|
|
|
|
def list_formats(self, info_dict):
|
|
|
|
|
def line(format, idlen=20):
|
|
|
|
|
return (('%-' + compat_str(idlen + 1) + 's%-10s%-12s%s') % (
|
|
|
|
|
format['format_id'],
|
|
|
|
|
format['ext'],
|
|
|
|
|
self.format_resolution(format),
|
|
|
|
|
format_note(format),
|
|
|
|
|
self._format_note(format),
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
formats = info_dict.get('formats', [info_dict])
|
|
|
|
@ -1197,8 +1197,8 @@ class YoutubeDL(object):
|
|
|
|
|
max(len(f['format_id']) for f in formats))
|
|
|
|
|
formats_s = [line(f, idlen) for f in formats]
|
|
|
|
|
if len(formats) > 1:
|
|
|
|
|
formats_s[0] += (' ' if format_note(formats[0]) else '') + '(worst)'
|
|
|
|
|
formats_s[-1] += (' ' if format_note(formats[-1]) else '') + '(best)'
|
|
|
|
|
formats_s[0] += (' ' if self._format_note(formats[0]) else '') + '(worst)'
|
|
|
|
|
formats_s[-1] += (' ' if self._format_note(formats[-1]) else '') + '(best)'
|
|
|
|
|
|
|
|
|
|
header_line = line({
|
|
|
|
|
'format_id': 'format code', 'ext': 'extension',
|
|
|
|
|