From 941d9b9bd967da209f43e0a871d6e80a871b25e9 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 25 Aug 2009 03:01:39 +0000 Subject: [PATCH] - Fixed BTJunkie search engine - Category support for TorrentReactor engine --- src/search_engine/engines/btjunkie.py | 4 ++-- src/search_engine/engines/torrentreactor.py | 8 +++++--- src/search_engine/engines/versions.txt | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/search_engine/engines/btjunkie.py b/src/search_engine/engines/btjunkie.py index 6a95310ae..23464fd5c 100644 --- a/src/search_engine/engines/btjunkie.py +++ b/src/search_engine/engines/btjunkie.py @@ -1,4 +1,4 @@ -#VERSION: 2.20 +#VERSION: 2.21 #AUTHORS: Christophe Dumez (chris@qbittorrent.org) # Redistribution and use in source and binary forms, with or without @@ -98,7 +98,7 @@ class btjunkie(object): while True and i<11: results = [] parser = self.SimpleSGMLParser(results, self.url) - dat = retrieve_url(self.url+'/search?q=%s&c=%s&o=52&p=%d'%(what, cat, i)) + dat = retrieve_url(self.url+'/search?q=%s&c=%s&o=52&p=%d'%(what, self.supported_categories[cat], i)) # Remove tags from page p = re.compile( '<[/]?font.*?>') dat = p.sub('', dat) diff --git a/src/search_engine/engines/torrentreactor.py b/src/search_engine/engines/torrentreactor.py index c6d01cfec..683387950 100644 --- a/src/search_engine/engines/torrentreactor.py +++ b/src/search_engine/engines/torrentreactor.py @@ -1,5 +1,6 @@ -#VERSION: 1.11 +#VERSION: 1.20 #AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net) +#CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org) # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -32,6 +33,7 @@ from helpers import retrieve_url, download_file class torrentreactor(object): url = 'http://www.torrentreactor.net' name = 'TorrentReactor.Net' + supported_categories = {'all': '', 'movies': '5', 'tv': '8', 'music': '6', 'games': '3', 'anime': '1', 'software': '2'} def download_torrent(self, info): print download_file(info) @@ -90,12 +92,12 @@ class torrentreactor(object): self.results = [] self.parser = self.SimpleSGMLParser(self.results, self.url) - def search(self, what): + def search(self, what, cat='all'): i = 0 while True and i<11: results = [] parser = self.SimpleSGMLParser(results, self.url) - dat = retrieve_url(self.url+'/search.php?search=&words=%s&cid=&sid=&type=2&orderby=a.seeds&asc=0&skip=%s'%(what,(i*35))) + dat = retrieve_url(self.url+'/search.php?search=&words=%s&cid=%s&sid=&type=2&orderby=a.seeds&asc=0&skip=%s'%(what, self.supported_categories[cat], (i*35))) 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 0da44210f..934a0a93f 100644 --- a/src/search_engine/engines/versions.txt +++ b/src/search_engine/engines/versions.txt @@ -1,5 +1,5 @@ isohunt: 1.21 torrentreactor: 1.11 -btjunkie: 2.20 +btjunkie: 2.21 mininova: 1.31 piratebay: 1.11