mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-14 03:52:22 -05:00
Fix for #390, add flag to use proxy settings
This commit is contained in:
parent
9084d7de19
commit
36359b1547
@ -165,7 +165,7 @@ def sanitizeFileName(name):
|
||||
return name
|
||||
|
||||
|
||||
def getURL(url, post_data=None, headers=None, params=None, timeout=30, json=False):
|
||||
def getURL(url, post_data=None, headers=None, params=None, timeout=30, json=False, use_proxy=False):
|
||||
"""
|
||||
Returns a byte-string retrieved from the url provider.
|
||||
"""
|
||||
@ -187,7 +187,9 @@ def getURL(url, post_data=None, headers=None, params=None, timeout=30, json=Fals
|
||||
|
||||
it = iter(req_headers)
|
||||
|
||||
if sickbeard.PROXY_SETTING:
|
||||
|
||||
if use_proxy and sickbeard.PROXY_SETTING:
|
||||
logger.log("Using proxy for url: " + url, logger.DEBUG)
|
||||
proxies = {
|
||||
"http": sickbeard.PROXY_SETTING,
|
||||
"https": sickbeard.PROXY_SETTING,
|
||||
|
@ -114,7 +114,7 @@ class GenericProvider:
|
||||
if not headers:
|
||||
headers = []
|
||||
|
||||
data = helpers.getURL(url, post_data, headers, json=json)
|
||||
data = helpers.getURL(url, post_data, headers, json=json, use_proxy=True)
|
||||
|
||||
if not data:
|
||||
logger.log(u"Error loading " + self.name + " URL: " + url, logger.ERROR)
|
||||
|
Loading…
Reference in New Issue
Block a user