From 12de907732bc05c02043e929e20e8735286d758a Mon Sep 17 00:00:00 2001 From: ngosang Date: Sat, 2 Apr 2016 21:51:04 +0200 Subject: [PATCH 1/2] [search engine] Remove filters from Torrentreactor and BTDigg --- src/searchengine/nova/engines/btdigg.py | 6 +----- src/searchengine/nova/engines/torrentreactor.py | 11 +++-------- src/searchengine/nova/engines/versions.txt | 4 ++-- src/searchengine/nova3/engines/btdigg.py | 6 +----- src/searchengine/nova3/engines/torrentreactor.py | 10 +++------- src/searchengine/nova3/engines/versions.txt | 4 ++-- 6 files changed, 12 insertions(+), 29 deletions(-) diff --git a/src/searchengine/nova/engines/btdigg.py b/src/searchengine/nova/engines/btdigg.py index 5cf0d82bb..d243b3296 100644 --- a/src/searchengine/nova/engines/btdigg.py +++ b/src/searchengine/nova/engines/btdigg.py @@ -1,4 +1,4 @@ -#VERSION: 1.31 +#VERSION: 1.32 #AUTHORS: BTDigg team (research@btdigg.org) # Contributors: Diego de las Heras (ngosang@hotmail.es) @@ -33,7 +33,6 @@ class btdigg(object): def search(self, what, cat='all'): req = urllib.unquote(what) - what_list = req.decode('utf8').split() i = 0 results = 0 while i < 3: @@ -44,9 +43,6 @@ class btdigg(object): info_hash, name, files, size, dl, seen = line.strip().split('\t')[:6] name = name.replace('|', '') - # BTDigg returns unrelated results, we need to filter - if not all(word in name.lower() for word in what_list): - continue res = dict(link = 'magnet:?xt=urn:btih:%s&dn=%s' % (info_hash, urllib.quote(name.encode('utf8'))), name = name, diff --git a/src/searchengine/nova/engines/torrentreactor.py b/src/searchengine/nova/engines/torrentreactor.py index 8e40535cd..201c196ff 100644 --- a/src/searchengine/nova/engines/torrentreactor.py +++ b/src/searchengine/nova/engines/torrentreactor.py @@ -1,4 +1,4 @@ -#VERSION: 1.41 +#VERSION: 1.42 #AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net) #CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org) # Bruno Barbieri (brunorex@gmail.com) @@ -42,14 +42,13 @@ class torrentreactor(object): print(download_file(info)) class SimpleHTMLParser(HTMLParser): - def __init__(self, results, url, what): + def __init__(self, results, url): HTMLParser.__init__(self) self.td_counter = None self.current_item = None self.results = results self.id = None self.url = url - self.what_list = urllib.unquote(what).decode('utf8').split() self.torrents_matcher = re_compile("/torrents/\d+.*") self.dispatcher = { 'a' : self.start_a, 'td' : self.start_td } @@ -88,10 +87,6 @@ class torrentreactor(object): self.td_counter = None # add item to results if self.current_item: - self.current_item['name'] = self.current_item['name'].decode('utf8') - # TorrentReactor returns unrelated results, we need to filter - if not all(word in self.current_item['name'].lower() for word in self.what_list): - return self.current_item['engine_url'] = self.url if not self.current_item['seeds'].isdigit(): self.current_item['seeds'] = 0 @@ -105,7 +100,7 @@ class torrentreactor(object): i = 0 dat = '' results = [] - parser = self.SimpleHTMLParser(results, self.url, what) + parser = self.SimpleHTMLParser(results, self.url) while i < 9: dat = retrieve_url('%s/torrents-search/%s/%s?sort=seeders.desc&type=all&period=none&categories=%s'%(self.url, what, (i*35), self.supported_categories[cat])) parser.feed(dat) diff --git a/src/searchengine/nova/engines/versions.txt b/src/searchengine/nova/engines/versions.txt index 2104ba55f..950d3736d 100644 --- a/src/searchengine/nova/engines/versions.txt +++ b/src/searchengine/nova/engines/versions.txt @@ -1,4 +1,4 @@ -btdigg: 1.31 +btdigg: 1.32 demonoid: 1.2 extratorrent: 2.04 kickasstorrents: 1.28 @@ -6,5 +6,5 @@ legittorrents: 2.01 mininova: 2.02 piratebay: 2.15 torlock: 2.0 -torrentreactor: 1.41 +torrentreactor: 1.42 torrentz: 2.20 diff --git a/src/searchengine/nova3/engines/btdigg.py b/src/searchengine/nova3/engines/btdigg.py index 16d8ede93..15d25826c 100644 --- a/src/searchengine/nova3/engines/btdigg.py +++ b/src/searchengine/nova3/engines/btdigg.py @@ -1,4 +1,4 @@ -#VERSION: 1.31 +#VERSION: 1.32 #AUTHORS: BTDigg team (research@btdigg.org) # Contributors: Diego de las Heras (ngosang@hotmail.es) @@ -33,7 +33,6 @@ class btdigg(object): def search(self, what, cat='all'): req = urllib.parse.unquote(what) - what_list = req.split() i = 0 results = 0 while i < 3: @@ -44,9 +43,6 @@ class btdigg(object): info_hash, name, files, size, dl, seen = line.strip().split('\t')[:6] name = name.replace('|', '') - # BTDigg returns unrelated results, we need to filter - if not all(word in name.lower() for word in what_list): - continue res = dict(link = 'magnet:?xt=urn:btih:%s&dn=%s' % (info_hash, urllib.parse.quote(name)), name = name, diff --git a/src/searchengine/nova3/engines/torrentreactor.py b/src/searchengine/nova3/engines/torrentreactor.py index 40fb561a4..33c95fa0e 100644 --- a/src/searchengine/nova3/engines/torrentreactor.py +++ b/src/searchengine/nova3/engines/torrentreactor.py @@ -1,4 +1,4 @@ -#VERSION: 1.41 +#VERSION: 1.42 #AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net) #CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org) # Bruno Barbieri (brunorex@gmail.com) @@ -42,14 +42,13 @@ class torrentreactor(object): print(download_file(info)) class SimpleHTMLParser(HTMLParser): - def __init__(self, results, url, what): + def __init__(self, results, url): HTMLParser.__init__(self) self.td_counter = None self.current_item = None self.results = results self.id = None self.url = url - self.what_list = parse.unquote(what).split() self.torrents_matcher = re_compile("/torrents/\d+.*") self.dispatcher = { 'a' : self.start_a, 'td' : self.start_td } @@ -88,9 +87,6 @@ class torrentreactor(object): self.td_counter = None # add item to results if self.current_item: - # TorrentReactor returns unrelated results, we need to filter - if not all(word in self.current_item['name'].lower() for word in self.what_list): - return self.current_item['engine_url'] = self.url if not self.current_item['seeds'].isdigit(): self.current_item['seeds'] = 0 @@ -104,7 +100,7 @@ class torrentreactor(object): i = 0 dat = '' results = [] - parser = self.SimpleHTMLParser(results, self.url, what) + parser = self.SimpleHTMLParser(results, self.url) while i < 9: dat = retrieve_url('%s/torrents-search/%s/%s?sort=seeders.desc&type=all&period=none&categories=%s'%(self.url, what, (i*35), self.supported_categories[cat])) parser.feed(dat) diff --git a/src/searchengine/nova3/engines/versions.txt b/src/searchengine/nova3/engines/versions.txt index 2104ba55f..950d3736d 100644 --- a/src/searchengine/nova3/engines/versions.txt +++ b/src/searchengine/nova3/engines/versions.txt @@ -1,4 +1,4 @@ -btdigg: 1.31 +btdigg: 1.32 demonoid: 1.2 extratorrent: 2.04 kickasstorrents: 1.28 @@ -6,5 +6,5 @@ legittorrents: 2.01 mininova: 2.02 piratebay: 2.15 torlock: 2.0 -torrentreactor: 1.41 +torrentreactor: 1.42 torrentz: 2.20 From 95eb0efabe8e64e11c19cb738cca48a1fb00471c Mon Sep 17 00:00:00 2001 From: ngosang Date: Sat, 2 Apr 2016 22:03:08 +0200 Subject: [PATCH 2/2] [search engine] Remove filters from Demonoid --- src/searchengine/nova/engines/demonoid.py | 4 ++-- src/searchengine/nova/engines/versions.txt | 2 +- src/searchengine/nova3/engines/demonoid.py | 4 ++-- src/searchengine/nova3/engines/versions.txt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/searchengine/nova/engines/demonoid.py b/src/searchengine/nova/engines/demonoid.py index f10e401a5..c88d5ffe6 100644 --- a/src/searchengine/nova/engines/demonoid.py +++ b/src/searchengine/nova/engines/demonoid.py @@ -1,4 +1,4 @@ -#VERSION: 1.2 +#VERSION: 1.21 #AUTHORS: Douman (custparasite@gmx.se) #CONTRIBUTORS: Diego de las Heras (ngosang@hotmail.es) @@ -121,7 +121,7 @@ class demonoid(object): """ Performs search """ #prepare query cat = self.supported_categories[cat.lower()] - query = "".join((self.url, "/files/?category=", cat, "&subcategory=All&quality=All&seeded=2&external=2&query=", what, "&to=1&uid=0&sort=S")) + query = "".join((self.url, "/files/?category=", cat, "&subcategory=All&quality=All&seeded=2&external=2&query=", what, "&uid=0&sort=S")) data = retrieve_url(query) diff --git a/src/searchengine/nova/engines/versions.txt b/src/searchengine/nova/engines/versions.txt index 950d3736d..74bec7feb 100644 --- a/src/searchengine/nova/engines/versions.txt +++ b/src/searchengine/nova/engines/versions.txt @@ -1,5 +1,5 @@ btdigg: 1.32 -demonoid: 1.2 +demonoid: 1.21 extratorrent: 2.04 kickasstorrents: 1.28 legittorrents: 2.01 diff --git a/src/searchengine/nova3/engines/demonoid.py b/src/searchengine/nova3/engines/demonoid.py index 296992675..694dbcfbc 100644 --- a/src/searchengine/nova3/engines/demonoid.py +++ b/src/searchengine/nova3/engines/demonoid.py @@ -1,4 +1,4 @@ -#VERSION: 1.2 +#VERSION: 1.21 #AUTHORS: Douman (custparasite@gmx.se) #CONTRIBUTORS: Diego de las Heras (ngosang@hotmail.es) @@ -121,7 +121,7 @@ class demonoid(object): """ Performs search """ #prepare query cat = self.supported_categories[cat.lower()] - query = "".join((self.url, "/files/?category=", cat, "&subcategory=All&quality=All&seeded=2&external=2&query=", what, "&to=1&uid=0&sort=S")) + query = "".join((self.url, "/files/?category=", cat, "&subcategory=All&quality=All&seeded=2&external=2&query=", what, "&uid=0&sort=S")) data = retrieve_url(query) diff --git a/src/searchengine/nova3/engines/versions.txt b/src/searchengine/nova3/engines/versions.txt index 950d3736d..74bec7feb 100644 --- a/src/searchengine/nova3/engines/versions.txt +++ b/src/searchengine/nova3/engines/versions.txt @@ -1,5 +1,5 @@ btdigg: 1.32 -demonoid: 1.2 +demonoid: 1.21 extratorrent: 2.04 kickasstorrents: 1.28 legittorrents: 2.01