mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
Bugfix for 23326151c4
This commit is contained in:
parent
854b0d325e
commit
666c36d58d
2 changed files with 8 additions and 15 deletions
|
@ -18,8 +18,8 @@
|
||||||
decodeArgument,
|
decodeArgument,
|
||||||
encodeFilename,
|
encodeFilename,
|
||||||
error_to_compat_str,
|
error_to_compat_str,
|
||||||
|
float_or_none,
|
||||||
format_bytes,
|
format_bytes,
|
||||||
int_or_none,
|
|
||||||
sanitize_open,
|
sanitize_open,
|
||||||
shell_quote,
|
shell_quote,
|
||||||
timeconvert,
|
timeconvert,
|
||||||
|
@ -406,9 +406,9 @@ def report_unable_to_resume(self):
|
||||||
|
|
||||||
def sleep_retry(self, retry_type, count):
|
def sleep_retry(self, retry_type, count):
|
||||||
sleep_func = self.params.get('retry_sleep_functions', {}).get(retry_type)
|
sleep_func = self.params.get('retry_sleep_functions', {}).get(retry_type)
|
||||||
delay = int_or_none(sleep_func(n=count - 1)) if sleep_func else None
|
delay = float_or_none(sleep_func(n=count - 1)) if sleep_func else None
|
||||||
if delay:
|
if delay:
|
||||||
self.__to_screen(f'Sleeping {delay} seconds ...')
|
self.__to_screen(f'Sleeping {delay:.2f} seconds ...')
|
||||||
time.sleep(delay)
|
time.sleep(delay)
|
||||||
return sleep_func is not None
|
return sleep_func is not None
|
||||||
|
|
||||||
|
|
|
@ -165,18 +165,11 @@ def _prepare_frag_download(self, ctx):
|
||||||
total_frags_str = 'unknown (live)'
|
total_frags_str = 'unknown (live)'
|
||||||
self.to_screen(f'[{self.FD_NAME}] Total fragments: {total_frags_str}')
|
self.to_screen(f'[{self.FD_NAME}] Total fragments: {total_frags_str}')
|
||||||
self.report_destination(ctx['filename'])
|
self.report_destination(ctx['filename'])
|
||||||
dl = HttpQuietDownloader(
|
dl = HttpQuietDownloader(self.ydl, {
|
||||||
self.ydl,
|
**self.params,
|
||||||
{
|
|
||||||
'continuedl': self.params.get('continuedl', True),
|
|
||||||
'quiet': self.params.get('quiet'),
|
|
||||||
'noprogress': True,
|
'noprogress': True,
|
||||||
'ratelimit': self.params.get('ratelimit'),
|
|
||||||
'retries': self.params.get('retries', 0),
|
|
||||||
'nopart': self.params.get('nopart', False),
|
|
||||||
'test': False,
|
'test': False,
|
||||||
}
|
})
|
||||||
)
|
|
||||||
tmpfilename = self.temp_name(ctx['filename'])
|
tmpfilename = self.temp_name(ctx['filename'])
|
||||||
open_mode = 'wb'
|
open_mode = 'wb'
|
||||||
resume_len = 0
|
resume_len = 0
|
||||||
|
|
Loading…
Reference in a new issue