aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-10-28 11:31:12 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-10-28 11:31:12 +0100
commit8abeeb94490e7066826ac086554be935a0c1dd94 (patch)
treedf47648261ea6155e5eb9c6d3fd6484148d8d1da
parentc1002e96e98f4851aed5de0142e8e2bd1ac4661c (diff)
Nicer --list-formats output
-rw-r--r--youtube_dl/YoutubeDL.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index b09eeff32..12621ff95 100644
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -757,23 +757,23 @@ class YoutubeDL(object):
archive_file.write(vid_id + u'\n')
@staticmethod
- def format_resolution(format):
+ def format_resolution(format, default='unknown'):
if format.get('height') is not None:
if format.get('width') is not None:
res = u'%sx%s' % (format['width'], format['height'])
else:
res = u'%sp' % format['height']
else:
- res = '???'
+ res = default
return res
def list_formats(self, info_dict):
formats_s = []
for format in info_dict.get('formats', [info_dict]):
- formats_s.append(u'%-15s: %-5s %-15s[%s]' % (
+ formats_s.append(u'%-15s%-7s %-15s%s' % (
format['format_id'],
format['ext'],
- format.get('format_note') or '-',
+ format.get('format_note', ''),
self.format_resolution(format),
)
)