1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Fixed issues with TorrentDay provider.

Fixed issues with newznab providers.
This commit is contained in:
echel0n 2014-12-11 14:06:23 -08:00
parent 2cd72ad4e8
commit d88dccd5ab
3 changed files with 16 additions and 15 deletions

View File

@ -238,7 +238,7 @@ class GenericProvider:
title = item.get('title')
if title:
title = title.replace(' ', '.')
title = u'' + title.replace(' ', '.')
url = item.get('link')
if url:

View File

@ -244,9 +244,12 @@ class NewznabProvider(generic.NZBProvider):
except:return self._checkAuth()
try:
err_code = int(data['feed']['error']['code'] or 0)
err_code = int(data['feed']['error']['code'])
err_desc = data['feed']['error']['description']
except:return True
if not err_code or err_desc:
raise
except:
return True
if err_code == 100:
raise AuthException("Your API key for " + self.name + " is incorrect, check your config.")
@ -430,13 +433,7 @@ class NewznabCache(tvcache.TVCache):
return self.provider._checkAuthFromData(data)
def _parseItem(self, item):
(title, url) = self._get_title_and_url(item)
tvrageid = 0
for attr in item.get('newznab_attr', []):
if attr['name'] == 'tvrageid':
tvrageid = int(attr['value'] or 0)
break
title, url = self._get_title_and_url(item)
self._checkItemAuth(title, url)
@ -446,7 +443,11 @@ class NewznabCache(tvcache.TVCache):
logger.DEBUG)
return None
url = self._translateLinkURL(url)
tvrageid = 0
for attr in item['newznab_attr'] if isinstance(item['newznab_attr'], list) else [item['newznab_attr']]:
if attr['name'] == 'tvrageid':
tvrageid = int(attr['value'] or 0)
break
logger.log(u"Attempting to add item from RSS to cache: " + title, logger.DEBUG)
return self._addCacheEntry(title, url, indexer_id=tvrageid)

View File

@ -35,10 +35,10 @@ from sickbeard.helpers import sanitizeSceneName
class TorrentDayProvider(generic.TorrentProvider):
urls = {'base_url': 'http://www.torrentday.com',
'login': 'http://www.torrentday.com/torrents/',
'search': 'http://www.torrentday.com/V3/API/API.php',
'download': 'http://www.torrentday.com/download.php/%s/%s'
urls = {'base_url': 'http://www.td.af',
'login': 'http://www.td.af/torrents/',
'search': 'http://www.td.af/V3/API/API.php',
'download': 'http://www.td.af/download.php/%s/%s'
}
def __init__(self):