mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
use proxies
This commit is contained in:
parent
f8ec897010
commit
aae27f36f6
@ -312,8 +312,13 @@ class KATProvider(generic.TorrentProvider):
|
|||||||
parsed = list(urlparse.urlparse(url))
|
parsed = list(urlparse.urlparse(url))
|
||||||
parsed[2] = re.sub("/{2,}", "/", parsed[2]) # replace two or more / with one
|
parsed[2] = re.sub("/{2,}", "/", parsed[2]) # replace two or more / with one
|
||||||
url = urlparse.urlunparse(parsed)
|
url = urlparse.urlunparse(parsed)
|
||||||
|
|
||||||
|
proxies = {
|
||||||
|
"http": "http://192.168.1.11:8118",
|
||||||
|
"https": "http://192.168.1.11:8118",
|
||||||
|
}
|
||||||
|
|
||||||
r = requests.get(url)
|
r = requests.get(url, proxies=proxies)
|
||||||
except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError), e:
|
except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError), e:
|
||||||
logger.log(u"Error loading " + self.name + " URL: " + str(sys.exc_info()) + " - " + ex(e), logger.ERROR)
|
logger.log(u"Error loading " + self.name + " URL: " + str(sys.exc_info()) + " - " + ex(e), logger.ERROR)
|
||||||
return None
|
return None
|
||||||
|
@ -307,8 +307,13 @@ class ThePirateBayProvider(generic.TorrentProvider):
|
|||||||
if self.proxy.isEnabled():
|
if self.proxy.isEnabled():
|
||||||
headers.update({'referer': self.proxy.getProxyURL()})
|
headers.update({'referer': self.proxy.getProxyURL()})
|
||||||
|
|
||||||
|
proxies = {
|
||||||
|
"http": "http://192.168.1.11:8118",
|
||||||
|
"https": "http://192.168.1.11:8118",
|
||||||
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
r = requests.get(url, headers=headers)
|
r = requests.get(url, headers=headers, proxies=proxies)
|
||||||
except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError), e:
|
except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError), e:
|
||||||
logger.log(u"Error loading " + self.name + " URL: " + str(sys.exc_info()) + " - " + ex(e), logger.ERROR)
|
logger.log(u"Error loading " + self.name + " URL: " + str(sys.exc_info()) + " - " + ex(e), logger.ERROR)
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user