1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-16 06:15:09 -05:00

Fix for issue #1034 - skipping: 'list' object has no attribute 'feed'

This commit is contained in:
echel0n 2014-12-08 00:27:39 -08:00
parent a5c961e3eb
commit 26e82caa84
2 changed files with 16 additions and 16 deletions

View File

@ -241,22 +241,20 @@ class NewznabProvider(generic.NZBProvider):
if not (data.entries and data.feed): if not (data.entries and data.feed):
return self._checkAuth() return self._checkAuth()
if data.feed.get('error', None): try:
code = data.feed.error.get('code', None) err_code = int(data['feed']['error']['code'] or 0)
err_desc = data['feed']['error']['description']
except:return True
if code == '100': if err_code == 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 code == '101': elif err_code == 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 code == '102': elif err_code == 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.error.description, logger.log(u"Unknown error given from " + self.name + ": " + err_desc, logger.ERROR)
logger.ERROR)
return False
return True
def _doSearch(self, search_params, search_mode='eponly', epcount=0, age=0): def _doSearch(self, search_params, search_mode='eponly', epcount=0, age=0):

View File

@ -63,7 +63,9 @@ class TvTorrentsProvider(generic.TorrentProvider):
if not (data.entries and data.feed): if not (data.entries and data.feed):
return self._checkAuth() return self._checkAuth()
title = data.feed.get('title', None) try:title = data['feed']['title']
except:return False
if "User can't be found" in title or "Invalid Hash" in title: if "User can't be found" in title or "Invalid Hash" in title:
logger.log(u"Incorrect authentication credentials for " + self.name + " : " + str(title), logger.log(u"Incorrect authentication credentials for " + self.name + " : " + str(title),
logger.DEBUG) logger.DEBUG)