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:
parent
2cd72ad4e8
commit
d88dccd5ab
@ -238,7 +238,7 @@ class GenericProvider:
|
|||||||
|
|
||||||
title = item.get('title')
|
title = item.get('title')
|
||||||
if title:
|
if title:
|
||||||
title = title.replace(' ', '.')
|
title = u'' + title.replace(' ', '.')
|
||||||
|
|
||||||
url = item.get('link')
|
url = item.get('link')
|
||||||
if url:
|
if url:
|
||||||
|
@ -244,9 +244,12 @@ class NewznabProvider(generic.NZBProvider):
|
|||||||
except:return self._checkAuth()
|
except:return self._checkAuth()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
err_code = int(data['feed']['error']['code'] or 0)
|
err_code = int(data['feed']['error']['code'])
|
||||||
err_desc = data['feed']['error']['description']
|
err_desc = data['feed']['error']['description']
|
||||||
except:return True
|
if not err_code or err_desc:
|
||||||
|
raise
|
||||||
|
except:
|
||||||
|
return True
|
||||||
|
|
||||||
if err_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.")
|
||||||
@ -430,13 +433,7 @@ class NewznabCache(tvcache.TVCache):
|
|||||||
return self.provider._checkAuthFromData(data)
|
return self.provider._checkAuthFromData(data)
|
||||||
|
|
||||||
def _parseItem(self, item):
|
def _parseItem(self, item):
|
||||||
(title, url) = self._get_title_and_url(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
|
|
||||||
|
|
||||||
self._checkItemAuth(title, url)
|
self._checkItemAuth(title, url)
|
||||||
|
|
||||||
@ -446,7 +443,11 @@ class NewznabCache(tvcache.TVCache):
|
|||||||
logger.DEBUG)
|
logger.DEBUG)
|
||||||
return None
|
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)
|
logger.log(u"Attempting to add item from RSS to cache: " + title, logger.DEBUG)
|
||||||
return self._addCacheEntry(title, url, indexer_id=tvrageid)
|
return self._addCacheEntry(title, url, indexer_id=tvrageid)
|
||||||
|
@ -35,10 +35,10 @@ from sickbeard.helpers import sanitizeSceneName
|
|||||||
|
|
||||||
|
|
||||||
class TorrentDayProvider(generic.TorrentProvider):
|
class TorrentDayProvider(generic.TorrentProvider):
|
||||||
urls = {'base_url': 'http://www.torrentday.com',
|
urls = {'base_url': 'http://www.td.af',
|
||||||
'login': 'http://www.torrentday.com/torrents/',
|
'login': 'http://www.td.af/torrents/',
|
||||||
'search': 'http://www.torrentday.com/V3/API/API.php',
|
'search': 'http://www.td.af/V3/API/API.php',
|
||||||
'download': 'http://www.torrentday.com/download.php/%s/%s'
|
'download': 'http://www.td.af/download.php/%s/%s'
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user