From 41931b33a9e03cd4a30d3c6e183e8fabf596c19b Mon Sep 17 00:00:00 2001 From: adam Date: Wed, 13 Aug 2014 17:14:37 +0800 Subject: [PATCH] Fixes Torrent Leech daily search URL Fixes TV torrents daily search no results --- sickbeard/providers/torrentleech.py | 8 ++++++-- sickbeard/providers/tvtorrents.py | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sickbeard/providers/torrentleech.py b/sickbeard/providers/torrentleech.py index 22009b2d..69401a55 100644 --- a/sickbeard/providers/torrentleech.py +++ b/sickbeard/providers/torrentleech.py @@ -45,6 +45,7 @@ class TorrentLeechProvider(generic.TorrentProvider): 'detail': 'https://torrentleech.org/torrent/%s', 'search': 'https://torrentleech.org/torrents/browse/index/query/%s/categories/%s', 'download': 'https://torrentleech.org%s', + 'index': 'https://torrentleech.org/torrents/browse/index/categories/%s', } def __init__(self): @@ -163,7 +164,10 @@ class TorrentLeechProvider(generic.TorrentProvider): if isinstance(search_string, unicode): search_string = unidecode(search_string) - searchURL = self.urls['search'] % (search_string, self.categories) + if mode == 'RSS': + searchURL = self.urls['index'] % self.categories + else: + searchURL = self.urls['search'] % (search_string, self.categories) logger.log(u"Search string: " + searchURL, logger.DEBUG) @@ -203,7 +207,7 @@ class TorrentLeechProvider(generic.TorrentProvider): continue item = title, download_url, id, seeders, leechers - logger.log(u"Found result: " + title + "(" + searchURL + ")", logger.DEBUG) + logger.log(u"Found result: " + title + "(" + download_url + ")", logger.DEBUG) items[mode].append(item) diff --git a/sickbeard/providers/tvtorrents.py b/sickbeard/providers/tvtorrents.py index e028ade6..b9364a49 100644 --- a/sickbeard/providers/tvtorrents.py +++ b/sickbeard/providers/tvtorrents.py @@ -95,8 +95,8 @@ class TvTorrentsCache(tvcache.TVCache): if not self.provider._checkAuthFromData(data): return [] - if data and 'data' in data: - return data['data'] + if data and 'entries' in data: + return data['entries'] else: return []