From 290bc8b7a66ddce104af6612f60e86daca3d5cf7 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 26 Aug 2009 06:02:17 +0000 Subject: [PATCH] - Support category-based requests in piratebay search plugin --- src/search_engine/engines/piratebay.py | 8 +++++--- src/search_engine/engines/versions.txt | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/search_engine/engines/piratebay.py b/src/search_engine/engines/piratebay.py index 0d6d70194..98f5da9b2 100644 --- a/src/search_engine/engines/piratebay.py +++ b/src/search_engine/engines/piratebay.py @@ -1,4 +1,4 @@ -#VERSION: 1.20 +#VERSION: 1.21 #AUTHORS: Fabien Devaux (fab@gnux.info) #CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org) @@ -33,7 +33,7 @@ from helpers import retrieve_url, download_file class piratebay(object): url = 'http://thepiratebay.org' name = 'The Pirate Bay' - supported_categories = {'all': '', 'movies': '', 'music': '', 'games': '', 'software': ''} + supported_categories = {'all': '0', 'movies': '200', 'music': '100', 'games': '400', 'software': '300'} def __init__(self): self.results = [] @@ -101,7 +101,9 @@ class piratebay(object): while True and i<11: results = [] parser = self.SimpleSGMLParser(results, self.url) - dat = retrieve_url(self.url+'/search/%s/%u/7' % (what, i)) + print self.url+'/search/%s/%u/99/%s' % (what, i, self.supported_categories[cat]) + return + dat = retrieve_url(self.url+'/search/%s/%u/99/%s' % (what, i, self.supported_categories[cat])) parser.feed(dat) parser.close() if len(results) <= 0: diff --git a/src/search_engine/engines/versions.txt b/src/search_engine/engines/versions.txt index 25db9442b..4dc0186ca 100644 --- a/src/search_engine/engines/versions.txt +++ b/src/search_engine/engines/versions.txt @@ -2,4 +2,4 @@ isohunt: 1.30 torrentreactor: 1.20 btjunkie: 2.21 mininova: 1.31 -piratebay: 1.11 +piratebay: 1.21