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):
return self._checkAuth()
if data.feed.get('error', None):
code = data.feed.error.get('code', None)
try:
err_code = int(data['feed']['error']['code'] or 0)
err_desc = data['feed']['error']['description']
except:return True
if code == '100':
raise AuthException("Your API key for " + self.name + " is incorrect, check your config.")
elif code == '101':
raise AuthException("Your account on " + self.name + " has been suspended, contact the administrator.")
elif code == '102':
raise AuthException(
"Your account isn't allowed to use the API on " + self.name + ", contact the administrator")
else:
logger.log(u"Unknown error given from " + self.name + ": " + data.feed.error.description,
logger.ERROR)
return False
return True
if err_code == 100:
raise AuthException("Your API key for " + self.name + " is incorrect, check your config.")
elif err_code == 101:
raise AuthException("Your account on " + self.name + " has been suspended, contact the administrator.")
elif err_code == 102:
raise AuthException(
"Your account isn't allowed to use the API on " + self.name + ", contact the administrator")
else:
logger.log(u"Unknown error given from " + self.name + ": " + err_desc, logger.ERROR)
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):
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:
logger.log(u"Incorrect authentication credentials for " + self.name + " : " + str(title),
logger.DEBUG)