refactor proxy handling code (#2357)

- allow gallery-dl proxy settings to overwrite environment proxies
- allow specifying different proxies for data extraction and download
  - add 'downloader.proxy' option
  - '-o extractor.proxy=–PROXY_URL -o downloader.proxy=null'
    now has the same effect as youtube-dl's '--geo-verification-proxy'
This commit is contained in:
Mike Fährmann
2022-03-10 23:32:16 +01:00
parent d50a1ec2cc
commit 47cf05c4ab
8 changed files with 52 additions and 23 deletions

View File

@@ -121,7 +121,8 @@ class HttpDownloader(DownloaderBase):
try:
response = self.session.request(
"GET", url, stream=True, headers=headers,
timeout=self.timeout, verify=self.verify)
timeout=self.timeout, verify=self.verify,
proxies=self.proxies)
except (ConnectionError, Timeout) as exc:
msg = str(exc)
continue