From 90f90936e126a41f4e9c225bad3745de05e10465 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 1 Jul 2012 14:34:37 +0300 Subject: [PATCH] Fix ThePirateBay search plugin --- src/searchengine/nova/engines/piratebay.py | 13 ++++++------- src/searchengine/nova3/engines/piratebay.py | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/searchengine/nova/engines/piratebay.py b/src/searchengine/nova/engines/piratebay.py index 2e990dd8e..f6eb1242b 100644 --- a/src/searchengine/nova/engines/piratebay.py +++ b/src/searchengine/nova/engines/piratebay.py @@ -1,4 +1,4 @@ -#VERSION: 1.41 +#VERSION: 1.50 #AUTHORS: Fabien Devaux (fab@gnux.info) #CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org) @@ -31,14 +31,14 @@ import sgmllib from helpers import retrieve_url, download_file class piratebay(object): - url = 'http://thepiratebay.org' + url = 'http://thepiratebay.se' name = 'The Pirate Bay' supported_categories = {'all': '0', 'movies': '200', 'music': '100', 'games': '400', 'software': '300'} - + def __init__(self): self.results = [] self.parser = self.SimpleSGMLParser(self.results, self.url) - + def download_torrent(self, info): print download_file(info) @@ -57,10 +57,9 @@ class piratebay(object): if params['href'].startswith('/torrent/'): self.current_item = {} self.td_counter = 0 - self.code = params['href'].split('/')[2] - self.current_item['desc_link'] = 'http://thepiratebay.org'+params['href'].strip() + self.current_item['desc_link'] = 'http://thepiratebay.se'+params['href'].strip() self.in_name = True - elif params['href'].startswith('http://torrents.thepiratebay.org/%s'%self.code): + elif params['href'].startswith('magnet:'): self.current_item['link']=params['href'].strip() self.in_name = False diff --git a/src/searchengine/nova3/engines/piratebay.py b/src/searchengine/nova3/engines/piratebay.py index ae862ac79..dd3cfa217 100644 --- a/src/searchengine/nova3/engines/piratebay.py +++ b/src/searchengine/nova3/engines/piratebay.py @@ -1,4 +1,4 @@ -#VERSION: 1.40 +#VERSION: 1.50 #AUTHORS: Fabien Devaux (fab@gnux.info) #CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org) @@ -31,14 +31,14 @@ import sgmllib3 from helpers import retrieve_url, download_file class piratebay(object): - url = 'http://thepiratebay.org' + url = 'http://thepiratebay.se' name = 'The Pirate Bay' supported_categories = {'all': '0', 'movies': '200', 'music': '100', 'games': '400', 'software': '300'} - + def __init__(self): self.results = [] self.parser = self.SimpleSGMLParser(self.results, self.url) - + def download_torrent(self, info): print(download_file(info)) @@ -57,10 +57,9 @@ class piratebay(object): if params['href'].startswith('/torrent/'): self.current_item = {} self.td_counter = 0 - self.code = params['href'].split('/')[2] - self.current_item['desc_link'] = 'http://thepiratebay.org'+params['href'].strip() + self.current_item['desc_link'] = 'http://thepiratebay.se'+params['href'].strip() self.in_name = True - elif params['href'].startswith('http://torrents.thepiratebay.org/%s'%self.code): + elif params['href'].startswith('magnet:'): self.current_item['link']=params['href'].strip() self.in_name = False