1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 16:45:17 +00:00

[cleanup Misc

Closes #5162
This commit is contained in:
pukkandan
2022-10-18 23:28:57 +05:30
parent cd5df121f3
commit d5d1df8afd
12 changed files with 48 additions and 32 deletions

View File

@ -333,7 +333,7 @@ class FileDownloader:
return tmpl
return default
_formats_bytes = lambda k: f'{format_bytes(s.get(k)):>10s}'
_format_bytes = lambda k: f'{format_bytes(s.get(k)):>10s}'
if s['status'] == 'finished':
if self.params.get('noprogress'):
@ -342,7 +342,7 @@ class FileDownloader:
s.update({
'speed': speed,
'_speed_str': self.format_speed(speed).strip(),
'_total_bytes_str': _formats_bytes('total_bytes'),
'_total_bytes_str': _format_bytes('total_bytes'),
'_elapsed_str': self.format_seconds(s.get('elapsed')),
'_percent_str': self.format_percent(100),
})
@ -363,9 +363,9 @@ class FileDownloader:
lambda: 100 * s['downloaded_bytes'] / s['total_bytes'],
lambda: 100 * s['downloaded_bytes'] / s['total_bytes_estimate'],
lambda: s['downloaded_bytes'] == 0 and 0)),
'_total_bytes_str': _formats_bytes('total_bytes'),
'_total_bytes_estimate_str': _formats_bytes('total_bytes_estimate'),
'_downloaded_bytes_str': _formats_bytes('downloaded_bytes'),
'_total_bytes_str': _format_bytes('total_bytes'),
'_total_bytes_estimate_str': _format_bytes('total_bytes_estimate'),
'_downloaded_bytes_str': _format_bytes('downloaded_bytes'),
'_elapsed_str': self.format_seconds(s.get('elapsed')),
})