mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-06-07 22:45:32 -04:00
News download: Support https proxies
This commit is contained in:
@@ -353,9 +353,14 @@ def browser(honor_time=True, max_time=2, mobile_browser=False, user_agent=None):
|
||||
if user_agent is None:
|
||||
user_agent = USER_AGENT_MOBILE if mobile_browser else USER_AGENT
|
||||
opener.addheaders = [('User-agent', user_agent)]
|
||||
http_proxy = get_proxies().get('http', None)
|
||||
proxies = get_proxies()
|
||||
http_proxy = proxies.get('http', None)
|
||||
if http_proxy:
|
||||
opener.set_proxies({'http':http_proxy})
|
||||
https_proxy = proxies.get('https', None)
|
||||
if https_proxy:
|
||||
opener.set_proxies({'https':https_proxy})
|
||||
|
||||
return opener
|
||||
|
||||
def fit_image(width, height, pwidth, pheight):
|
||||
|
||||
Reference in New Issue
Block a user