1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-05-16 01:59:33 +00:00

[downloader/external] Add support for rate limit and retries for wget

This commit is contained in:
Sergey M․ 2019-02-23 00:58:56 +07:00
parent 37b239b3b6
commit 8c80603f1a
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -164,6 +164,12 @@ class WgetFD(ExternalFD):
cmd = [self.exe, '-O', tmpfilename, '-nv', '--no-cookies']
for key, val in info_dict['http_headers'].items():
cmd += ['--header', '%s: %s' % (key, val)]
cmd += self._option('--limit-rate', 'ratelimit')
retry = self._option('--tries', 'retries')
if len(retry) == 2:
if retry[1] in ('inf', 'infinite'):
retry[1] = '0'
cmd += retry
cmd += self._option('--bind-address', 'source_address')
cmd += self._option('--proxy', 'proxy')
cmd += self._valueless_option('--no-check-certificate', 'nocheckcertificate')