mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-24 05:36:56 +01:00
[downloader/common] Limit displaying 2 digits after decimal point in sleep interval message
This commit is contained in:
parent
103f8c8d36
commit
d374d943f3
@ -347,7 +347,10 @@ def download(self, filename, info_dict):
|
|||||||
if min_sleep_interval:
|
if min_sleep_interval:
|
||||||
max_sleep_interval = self.params.get('max_sleep_interval', min_sleep_interval)
|
max_sleep_interval = self.params.get('max_sleep_interval', min_sleep_interval)
|
||||||
sleep_interval = random.uniform(min_sleep_interval, max_sleep_interval)
|
sleep_interval = random.uniform(min_sleep_interval, max_sleep_interval)
|
||||||
self.to_screen('[download] Sleeping %s seconds...' % sleep_interval)
|
self.to_screen(
|
||||||
|
'[download] Sleeping %s seconds...' % (
|
||||||
|
int(sleep_interval) if sleep_interval.is_integer()
|
||||||
|
else '%.2f' % sleep_interval))
|
||||||
time.sleep(sleep_interval)
|
time.sleep(sleep_interval)
|
||||||
|
|
||||||
return self.real_download(filename, info_dict)
|
return self.real_download(filename, info_dict)
|
||||||
|
Loading…
Reference in New Issue
Block a user