mirror of
https://github.com/soimort/you-get.git
synced 2025-02-11 12:42:29 +03:00
src/you_get/common.py - 修正语法错误
This commit is contained in:
parent
61502e5f72
commit
1cb6fedf44
@ -653,7 +653,7 @@ class SimpleProgressBar:
|
|||||||
total_str = '%5s' % round(self.total_size / 1048576, 1)
|
total_str = '%5s' % round(self.total_size / 1048576, 1)
|
||||||
total_str_width = max(len(total_str), 5)
|
total_str_width = max(len(total_str), 5)
|
||||||
self.bar_size = self.term_size - 27 - 2*total_pieces_len - 2*total_str_width
|
self.bar_size = self.term_size - 27 - 2*total_pieces_len - 2*total_str_width
|
||||||
self.bar = '{:>4}%% ({:>%s}/%sMB) ©À{:©¤<%s}©È[{:>%s}/{:>%s}] {}' % (
|
self.bar = '{:>4}%% ({:>%s}/%sMB) ├{:─<%s}┤[{:>%s}/{:>%s}] {}' % (
|
||||||
total_str_width, total_str, self.bar_size, total_pieces_len, total_pieces_len)
|
total_str_width, total_str, self.bar_size, total_pieces_len, total_pieces_len)
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
@ -665,12 +665,12 @@ class SimpleProgressBar:
|
|||||||
dots = bar_size * int(percent) // 100
|
dots = bar_size * int(percent) // 100
|
||||||
plus = int(percent) - dots // bar_size * 100
|
plus = int(percent) - dots // bar_size * 100
|
||||||
if plus > 0.8:
|
if plus > 0.8:
|
||||||
plus = '¨€'
|
plus = '█'
|
||||||
elif plus > 0.4:
|
elif plus > 0.4:
|
||||||
plus = '>'
|
plus = '>'
|
||||||
else:
|
else:
|
||||||
plus = ''
|
plus = ''
|
||||||
bar = '¨€' * dots + plus
|
bar = '█' * dots + plus
|
||||||
bar = self.bar.format(percent, round(self.received / 1048576, 1), bar, self.current_piece, self.total_pieces, self.speed)
|
bar = self.bar.format(percent, round(self.received / 1048576, 1), bar, self.current_piece, self.total_pieces, self.speed)
|
||||||
sys.stdout.write('\r' + bar)
|
sys.stdout.write('\r' + bar)
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
@ -1367,12 +1367,10 @@ def script_main(script_name, download, download_playlist, **kwargs):
|
|||||||
else:
|
else:
|
||||||
download_main(download, download_playlist, args, playlist, stream_id=stream_id, extractor_proxy=extractor_proxy, output_dir=output_dir, merge=merge, info_only=info_only, json_output=json_output, caption=caption)
|
download_main(download, download_playlist, args, playlist, stream_id=stream_id, extractor_proxy=extractor_proxy, output_dir=output_dir, merge=merge, info_only=info_only, json_output=json_output, caption=caption)
|
||||||
else:
|
else:
|
||||||
download_main(download, download_playlist, args, playlist, stream_id=stream_id, extractor_proxy=extractor_proxy, output_dir=output_dir, merge=merge, info_only=info_only, json_output=json_output, caption=caption)
|
if not extractor_proxy:
|
||||||
else:
|
download_main(download, download_playlist, args, playlist, output_dir=output_dir, merge=merge, info_only=info_only, json_output=json_output, caption=caption)
|
||||||
if not extractor_proxy:
|
else:
|
||||||
download_main(download, download_playlist, args, playlist, output_dir=output_dir, merge=merge, info_only=info_only, json_output=json_output, caption=caption)
|
download_main(download, download_playlist, args, playlist, extractor_proxy=extractor_proxy, output_dir=output_dir, merge=merge, info_only=info_only, json_output=json_output, caption=caption)
|
||||||
else:
|
|
||||||
download_main(download, download_playlist, args, playlist, extractor_proxy=extractor_proxy, output_dir=output_dir, merge=merge, info_only=info_only, json_output=json_output, caption=caption)
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
if traceback:
|
if traceback:
|
||||||
raise
|
raise
|
||||||
|
Loading…
Reference in New Issue
Block a user