Clean up format_note() a bit

I want to do a lot more on this later for readability.
This commit is contained in:
AGSPhoenix 2014-03-06 20:28:14 -05:00
parent 3984bcded8
commit 490919d461

View File

@ -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):