diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-10-30 01:09:26 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-10-30 01:09:26 +0100 |
commit | 94badb2599e54bfd711b38f3a74c552ff652d6d3 (patch) | |
tree | 6b8e90e2e152d647616cc9e00a2c6088d292214c /youtube_dl | |
parent | b9a836515fad5df57a86412b2cd41c49869ec0d6 (diff) |
Fix output indenting for --list-formats
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/YoutubeDL.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 260cd2809..898533496 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -780,10 +780,11 @@ class YoutubeDL(object): ) ) - formats_s = list(map(line, info_dict.get('formats', [info_dict]))) - if len(formats_s) != 1: - formats_s[0] += (' ' if formats_s[0] else '') + '(worst)' - formats_s[-1] += (' ' if formats_s[-1] else '') + '(best)' + formats = info_dict.get('formats', [info_dict]) + formats_s = list(map(line, formats)) + if len(formats) > 1: + formats_s[0] += (' ' if formats[0].get('format_note') else '') + '(worst)' + formats_s[-1] += (' ' if formats[-1].get('format_note') else '') + '(best)' header_line = line({ 'format_id': u'format code', 'ext': u'extension', |