projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[downloader/external] Forward --proxy to wget and aria2c
[youtube-dl]
/
youtube_dl
/
downloader
/
external.py
diff --git
a/youtube_dl/downloader/external.py
b/youtube_dl/downloader/external.py
index 07ce59f7d9a993e5c6b03b349b5b7158ae32433a..49d806ee499cb3872f9195804fc6c3f103f6fe3e 100644
(file)
--- a/
youtube_dl/downloader/external.py
+++ b/
youtube_dl/downloader/external.py
@@
-51,6
+51,14
@@
class ExternalFD(FileDownloader):
return []
return [command_option, source_address]
return []
return [command_option, source_address]
+ def _option(self, command_option, param):
+ param = self.params.get(param)
+ if param is None:
+ return []
+ if isinstance(param, bool):
+ return [command_option]
+ return [command_option, param]
+
def _no_check_certificate(self, command_option):
return [command_option] if self.params.get('nocheckcertificate', False) else []
def _no_check_certificate(self, command_option):
return [command_option] if self.params.get('nocheckcertificate', False) else []
@@
-102,6
+110,7
@@
class WgetFD(ExternalFD):
for key, val in info_dict['http_headers'].items():
cmd += ['--header', '%s: %s' % (key, val)]
cmd += self._source_address('--bind-address')
for key, val in info_dict['http_headers'].items():
cmd += ['--header', '%s: %s' % (key, val)]
cmd += self._source_address('--bind-address')
+ cmd += self._option('--proxy', 'proxy')
cmd += self._no_check_certificate('--no-check-certificate')
cmd += self._configuration_args()
cmd += ['--', info_dict['url']]
cmd += self._no_check_certificate('--no-check-certificate')
cmd += self._configuration_args()
cmd += ['--', info_dict['url']]
@@
-120,6
+129,7
@@
class Aria2cFD(ExternalFD):
for key, val in info_dict['http_headers'].items():
cmd += ['--header', '%s: %s' % (key, val)]
cmd += self._source_address('--interface')
for key, val in info_dict['http_headers'].items():
cmd += ['--header', '%s: %s' % (key, val)]
cmd += self._source_address('--interface')
+ cmd += self._option('--all-proxy', 'proxy')
cmd += ['--', info_dict['url']]
return cmd
cmd += ['--', info_dict['url']]
return cmd