From c73ed8a4c56cd448c863f20e4c09b4282b62f116 Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 16 Aug 2013 20:05:30 +0200 Subject: [PATCH] Add multiple categories for BRRIP on TPB. fix #2025 --- couchpotato/core/providers/torrent/thepiratebay/main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/providers/torrent/thepiratebay/main.py b/couchpotato/core/providers/torrent/thepiratebay/main.py index 10608157..82cbbe9e 100644 --- a/couchpotato/core/providers/torrent/thepiratebay/main.py +++ b/couchpotato/core/providers/torrent/thepiratebay/main.py @@ -15,12 +15,13 @@ class ThePirateBay(TorrentMagnetProvider): urls = { 'detail': '%s/torrent/%s', - 'search': '%s/search/%s/%s/7/%d' + 'search': '%s/search/%s/%s/7/%s' } cat_ids = [ ([207], ['720p', '1080p']), - ([201], ['cam', 'ts', 'dvdrip', 'tc', 'r5', 'scr', 'brrip']), + ([201], ['cam', 'ts', 'dvdrip', 'tc', 'r5', 'scr']), + ([201, 207], ['brrip']), ([202], ['dvdr']) ] @@ -50,10 +51,11 @@ class ThePirateBay(TorrentMagnetProvider): page = 0 total_pages = 1 + cats = self.getCatId(quality['identifier']) while page < total_pages: - search_url = self.urls['search'] % (self.getDomain(), tryUrlencode('"%s" %s' % (title, movie['library']['year'])), page, self.getCatId(quality['identifier'])[0]) + search_url = self.urls['search'] % (self.getDomain(), tryUrlencode('"%s" %s' % (title, movie['library']['year'])), page, ','.join(str(x) for x in cats)) page += 1 data = self.getHTMLData(search_url)