Browse Source

IPT provider now searches in multiple categories.

pull/2356/head
Dean Gardiner 12 years ago
parent
commit
2d2b0c9048
  1. 10
      couchpotato/core/providers/torrent/iptorrents/main.py

10
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):

Loading…
Cancel
Save