From 490919d4612a044bca239c634039ef3b3b32ef5b Mon Sep 17 00:00:00 2001 From: AGSPhoenix Date: Thu, 6 Mar 2014 20:28:14 -0500 Subject: [PATCH] Clean up format_note() a bit I want to do a lot more on this later for readability. --- youtube_dl/YoutubeDL.py | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 4d0c2f973..8e83589d9 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1105,39 +1105,29 @@ class YoutubeDL(object): if fdict.get('tbr') is not None: res += '%4dk ' % fdict['tbr'] if fdict.get('container') is not None: - if res: - res += ', ' - res += '%s container' % fdict['container'] + res += ', %s container' % fdict['container'] if (fdict.get('vcodec') is not None and fdict.get('vcodec') != 'none'): - if res: - res += ', ' - res += fdict['vcodec'] + res += ', ' + fdict['vcodec'] if fdict.get('vbr') is not None: res += '@' elif fdict.get('vbr') is not None and fdict.get('abr') is not None: - res += 'video@' + res += ', video@' if fdict.get('vbr') is not None: res += '%4dk' % fdict['vbr'] if fdict.get('acodec') is not None: - if res: - res += ', ' if fdict['acodec'] == 'none': - res += 'video only' + res += ', video only' else: - res += '%-5s' % fdict['acodec'] + res += ', %-5s' % fdict['acodec'] elif fdict.get('abr') is not None: - if res: - res += ', ' - res += 'audio' + res += ', audio' if fdict.get('abr') is not None: res += '@%3dk' % fdict['abr'] if fdict.get('asr') is not None: res += ' (%5dHz)' % fdict['asr'] if fdict.get('filesize') is not None: - if res: - res += ', ' - res += format_bytes(fdict['filesize']) + res += ', ' + format_bytes(fdict['filesize']) return res def line(format, idlen=20):