|
|
|
@ -312,7 +312,7 @@ class FileDownloader(object):
|
|
|
|
|
def report_retry(self, err, count, retries):
|
|
|
|
|
"""Report retry in case of HTTP error 5xx"""
|
|
|
|
|
self.to_screen(
|
|
|
|
|
'[download] Got server HTTP error: %s. Retrying (attempt %d of %s)...'
|
|
|
|
|
'[download] Got server HTTP error: %s. Retrying (attempt %d of %s) ...'
|
|
|
|
|
% (error_to_compat_str(err), count, self.format_retries(retries)))
|
|
|
|
|
|
|
|
|
|
def report_file_already_downloaded(self, file_name):
|
|
|
|
@ -359,7 +359,7 @@ class FileDownloader(object):
|
|
|
|
|
max_sleep_interval = self.params.get('max_sleep_interval', min_sleep_interval)
|
|
|
|
|
sleep_interval = random.uniform(min_sleep_interval, max_sleep_interval)
|
|
|
|
|
self.to_screen(
|
|
|
|
|
'[download] Sleeping %s seconds...' % (
|
|
|
|
|
'[download] Sleeping %s seconds ...' % (
|
|
|
|
|
int(sleep_interval) if sleep_interval.is_integer()
|
|
|
|
|
else '%.2f' % sleep_interval))
|
|
|
|
|
time.sleep(sleep_interval)
|
|
|
|
@ -369,7 +369,7 @@ class FileDownloader(object):
|
|
|
|
|
sleep_interval_sub = self.params.get('sleep_interval_subtitles')
|
|
|
|
|
if sleep_interval_sub > 0:
|
|
|
|
|
self.to_screen(
|
|
|
|
|
'[download] Sleeping %s seconds...' % (
|
|
|
|
|
'[download] Sleeping %s seconds ...' % (
|
|
|
|
|
sleep_interval_sub))
|
|
|
|
|
time.sleep(sleep_interval_sub)
|
|
|
|
|
return self.real_download(filename, info_dict), True
|
|
|
|
|