From: Sergey M․ Date: Fri, 22 Feb 2019 17:58:56 +0000 (+0700) Subject: [downloader/external] Add support for rate limit and retries for wget X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=8c80603f1adea843d96c0598b902106c7a3efb7f;p=youtube-dl [downloader/external] Add support for rate limit and retries for wget --- diff --git a/youtube_dl/downloader/external.py b/youtube_dl/downloader/external.py index 0b88bfd94..22e6093b3 100644 --- a/youtube_dl/downloader/external.py +++ b/youtube_dl/downloader/external.py @@ -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')