mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-17 23:05:11 -05:00
Fixes error "Invalid username or password for SceneAccess Check your settings"
This commit is contained in:
parent
483ea3baf7
commit
4eb9000676
@ -83,7 +83,8 @@ class SCCProvider(generic.TorrentProvider):
|
|||||||
self.session = requests.Session()
|
self.session = requests.Session()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = self.session.post(self.urls['login'], data=login_params, timeout=30, verify=False)
|
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'}
|
||||||
|
response = self.session.post(self.urls['login'], data=login_params, headers=headers, timeout=30, verify=False)
|
||||||
except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError), e:
|
except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError), e:
|
||||||
logger.log(u'Unable to connect to ' + self.name + ' provider: ' + ex(e), logger.ERROR)
|
logger.log(u'Unable to connect to ' + self.name + ' provider: ' + ex(e), logger.ERROR)
|
||||||
return False
|
return False
|
||||||
@ -230,15 +231,19 @@ class SCCProvider(generic.TorrentProvider):
|
|||||||
self._doLogin()
|
self._doLogin()
|
||||||
|
|
||||||
if not headers:
|
if not headers:
|
||||||
headers = []
|
headers = {}
|
||||||
|
|
||||||
|
headers.update({'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'})
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Remove double-slashes from url
|
# Remove double-slashes from url
|
||||||
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)
|
||||||
|
|
||||||
response = self.session.get(url, verify=False)
|
|
||||||
|
|
||||||
|
response = self.session.get(url, headers=headers, verify=False)
|
||||||
except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError), e:
|
except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError), e:
|
||||||
logger.log(u"Error loading " + self.name + " URL: " + ex(e), logger.ERROR)
|
logger.log(u"Error loading " + self.name + " URL: " + ex(e), logger.ERROR)
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user