projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
37b239b
)
[downloader/external] Add support for rate limit and retries for wget
author
Sergey M․
<dstftw@gmail.com>
Fri, 22 Feb 2019 17:58:56 +0000
(
00:58
+0700)
committer
Sergey M․
<dstftw@gmail.com>
Fri, 22 Feb 2019 18:00:03 +0000
(
01:00
+0700)
youtube_dl/downloader/external.py
patch
|
blob
|
history
diff --git
a/youtube_dl/downloader/external.py
b/youtube_dl/downloader/external.py
index 0b88bfd94c46f42c375b77b8988c7221580d01b6..22e6093b3763d26900a67a44f0007df9f6880fb4 100644
(file)
--- 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.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')
cmd += self._option('--bind-address', 'source_address')
cmd += self._option('--proxy', 'proxy')
cmd += self._valueless_option('--no-check-certificate', 'nocheckcertificate')