From 2d2b0c90486b548193b71078522ae72651b0518a Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Thu, 3 Oct 2013 00:30:10 +1300 Subject: [PATCH] IPT provider now searches in multiple categories. --- couchpotato/core/providers/torrent/iptorrents/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/couchpotato/core/providers/torrent/iptorrents/main.py b/couchpotato/core/providers/torrent/iptorrents/main.py index 79e83d9..7d358cb 100644 --- a/couchpotato/core/providers/torrent/iptorrents/main.py +++ b/couchpotato/core/providers/torrent/iptorrents/main.py @@ -23,7 +23,7 @@ class Base(TorrentProvider): 'base_url' : 'http://www.iptorrents.com', 'login' : 'http://www.iptorrents.com/torrents/', 'login_check': 'http://www.iptorrents.com/inbox.php', - 'search' : 'http://www.iptorrents.com/torrents/?l%d=1%%s&q=%s&qf=ti&p=%%d', + 'search' : 'http://www.iptorrents.com/torrents/?%s%%s&q=%s&qf=ti&p=%%d', } http_time_between_calls = 1 #seconds @@ -31,13 +31,13 @@ class Base(TorrentProvider): def _buildUrl(self, query, quality_identifier, cat_ids_group = None): - # TODO this should support searching multiple cat_ids under a group - cat_id = self.getCatId(quality_identifier, cat_ids_group)[0] - if not cat_id: + cat_ids = self.getCatId(quality_identifier, cat_ids_group) + + if not len(cat_ids): log.warning('Unable to find category for quality %s', quality_identifier) return - return self.urls['search'] % (cat_id, tryUrlencode(query).replace('%', '%%')) + return self.urls['search'] % ("&".join(("l%d=" % x) for x in cat_ids), tryUrlencode(query).replace('%', '%%')) def _searchOnTitle(self, title, media, quality, results):