From 4eb900067658d8c6c50393bb73144211fb11eec3 Mon Sep 17 00:00:00 2001 From: tehspede Date: Wed, 23 Apr 2014 00:29:03 +0300 Subject: [PATCH 1/3] Fixes error "Invalid username or password for SceneAccess Check your settings" --- sickbeard/providers/scc.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sickbeard/providers/scc.py b/sickbeard/providers/scc.py index 1e563c13..ce82b77c 100644 --- a/sickbeard/providers/scc.py +++ b/sickbeard/providers/scc.py @@ -83,7 +83,8 @@ class SCCProvider(generic.TorrentProvider): self.session = requests.Session() 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: logger.log(u'Unable to connect to ' + self.name + ' provider: ' + ex(e), logger.ERROR) return False @@ -230,15 +231,19 @@ class SCCProvider(generic.TorrentProvider): self._doLogin() 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: - # Remove double-slashes from url + # Remove double-slashes from url parsed = list(urlparse.urlparse(url)) parsed[2] = re.sub("/{2,}", "/", parsed[2]) # replace two or more / with one 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: logger.log(u"Error loading " + self.name + " URL: " + ex(e), logger.ERROR) return None From 5b713f0262644023ebbd335ea1172d9ffcd20a84 Mon Sep 17 00:00:00 2001 From: tehspede Date: Wed, 23 Apr 2014 00:41:01 +0300 Subject: [PATCH 2/3] Update scc.py --- sickbeard/providers/scc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sickbeard/providers/scc.py b/sickbeard/providers/scc.py index ce82b77c..77996a44 100644 --- a/sickbeard/providers/scc.py +++ b/sickbeard/providers/scc.py @@ -236,7 +236,7 @@ class SCCProvider(generic.TorrentProvider): 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: - # Remove double-slashes from url + # Remove double-slashes from url parsed = list(urlparse.urlparse(url)) parsed[2] = re.sub("/{2,}", "/", parsed[2]) # replace two or more / with one url = urlparse.urlunparse(parsed) From 90620e47b88ef52aaa6a64dae21588c54de03bee Mon Sep 17 00:00:00 2001 From: tehspede Date: Wed, 23 Apr 2014 00:43:54 +0300 Subject: [PATCH 3/3] Update scc.py --- sickbeard/providers/scc.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sickbeard/providers/scc.py b/sickbeard/providers/scc.py index 77996a44..86b5e02f 100644 --- a/sickbeard/providers/scc.py +++ b/sickbeard/providers/scc.py @@ -240,9 +240,7 @@ class SCCProvider(generic.TorrentProvider): parsed = list(urlparse.urlparse(url)) parsed[2] = re.sub("/{2,}", "/", parsed[2]) # replace two or more / with one url = urlparse.urlunparse(parsed) - - - + response = self.session.get(url, headers=headers, verify=False) except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError), e: logger.log(u"Error loading " + self.name + " URL: " + ex(e), logger.ERROR)