[cleanup] Misc cleanup

Closes #1805, closes #1800
This commit is contained in:
pukkandan
2021-11-29 02:52:52 +05:30
parent 06dfe0a0a2
commit f304da8a29
16 changed files with 87 additions and 79 deletions

View File

@@ -848,7 +848,7 @@ class YoutubeDL(object):
class Styles(Enum):
HEADERS = 'yellow'
EMPHASIS = 'blue'
EMPHASIS = 'light blue'
ID = 'green'
DELIM = 'blue'
ERROR = 'red'
@@ -863,7 +863,7 @@ class YoutubeDL(object):
if fallback is not None and text != original_text:
text = fallback
if isinstance(f, self.Styles):
f = f._value_
f = f.value
return format_text(text, f) if allow_colors else text if fallback is None else fallback
def _format_screen(self, *args, **kwargs):
@@ -3223,15 +3223,19 @@ class YoutubeDL(object):
def _format_note(self, fdict):
res = ''
if fdict.get('ext') in ['f4f', 'f4m']:
res += '(unsupported) '
res += '(unsupported)'
if fdict.get('language'):
if res:
res += ' '
res += '[%s] ' % fdict['language']
res += '[%s]' % fdict['language']
if fdict.get('format_note') is not None:
res += fdict['format_note'] + ' '
if res:
res += ' '
res += fdict['format_note']
if fdict.get('tbr') is not None:
res += '%4dk ' % fdict['tbr']
if res:
res += ', '
res += '%4dk' % fdict['tbr']
if fdict.get('container') is not None:
if res:
res += ', '