mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
Fix for no status attribute error
This commit is contained in:
parent
f9cd37c243
commit
8d4d1a21cd
@ -166,21 +166,21 @@ class NewznabProvider(generic.NZBProvider):
|
|||||||
if data is None:
|
if data is None:
|
||||||
return self._checkAuth()
|
return self._checkAuth()
|
||||||
|
|
||||||
status = data.status
|
if 'status' in data:
|
||||||
if status:
|
if data.status in [200, 301]:
|
||||||
if status in [200, 301]:
|
|
||||||
return True
|
return True
|
||||||
if status == 100:
|
if data.status == 100:
|
||||||
raise AuthException("Your API key for " + self.name + " is incorrect, check your config.")
|
raise AuthException("Your API key for " + self.name + " is incorrect, check your config.")
|
||||||
elif status == 101:
|
elif data.status == 101:
|
||||||
raise AuthException("Your account on " + self.name + " has been suspended, contact the administrator.")
|
raise AuthException("Your account on " + self.name + " has been suspended, contact the administrator.")
|
||||||
elif status == 102:
|
elif data.status == 102:
|
||||||
raise AuthException(
|
raise AuthException(
|
||||||
"Your account isn't allowed to use the API on " + self.name + ", contact the administrator")
|
"Your account isn't allowed to use the API on " + self.name + ", contact the administrator")
|
||||||
else:
|
else:
|
||||||
logger.log(u"Unknown error given from " + self.name + ": " + data.feed.title,
|
logger.log(u"Unknown error given from " + self.name + ": " + data.feed.title,
|
||||||
logger.ERROR)
|
logger.ERROR)
|
||||||
return False
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def _doSearch(self, search_params, show=None, max_age=0):
|
def _doSearch(self, search_params, show=None, max_age=0):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user