[search engine] Cosmetic update TorrentReactor

This commit is contained in:
DoumanAsh 2015-04-08 07:52:02 +03:00 committed by sledgehammer999
commit 639f5b2d20
6 changed files with 12 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 951 B

Before After
Before After

View file

@ -1,4 +1,4 @@
#VERSION: 1.35 #VERSION: 1.36
#AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net) #AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net)
#CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org) #CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org)
# Bruno Barbieri (brunorex@gmail.com) # Bruno Barbieri (brunorex@gmail.com)
@ -32,11 +32,11 @@ from helpers import download_file
import urllib import urllib
from HTMLParser import HTMLParser from HTMLParser import HTMLParser
from httplib import HTTPConnection as http from httplib import HTTPConnection as http
import re from re import compile as re_compile
class torrentreactor(object): class torrentreactor(object):
url = 'http://www.torrentreactor.net' url = 'http://www.torrentreactor.net'
name = 'TorrentReactor.Net' name = 'TorrentReactor'
supported_categories = {'all': '', 'movies': '5', 'tv': '8', 'music': '6', 'games': '3', 'anime': '1', 'software': '2'} supported_categories = {'all': '', 'movies': '5', 'tv': '8', 'music': '6', 'games': '3', 'anime': '1', 'software': '2'}
def download_torrent(self, info): def download_torrent(self, info):
@ -50,6 +50,7 @@ class torrentreactor(object):
self.results = results self.results = results
self.id = None self.id = None
self.url = url self.url = url
self.torrents_matcher = re_compile("/torrents/\d+.*")
self.dispatcher = { 'a' : self.start_a, 'td' : self.start_td } self.dispatcher = { 'a' : self.start_a, 'td' : self.start_td }
def handle_starttag(self, tag, attrs): def handle_starttag(self, tag, attrs):
@ -58,7 +59,7 @@ class torrentreactor(object):
def start_a(self, attr): def start_a(self, attr):
params = dict(attr) params = dict(attr)
if re.match("/torrents/\d+.*", params['href']): if self.torrents_matcher.match(params['href']):
self.current_item = {} self.current_item = {}
self.current_item['desc_link'] = self.url+params['href'].strip() self.current_item['desc_link'] = self.url+params['href'].strip()
elif 'torrentreactor.net/download.php' in params['href']: elif 'torrentreactor.net/download.php' in params['href']:

View file

@ -1,5 +1,5 @@
extratorrent: 1.2 extratorrent: 1.2
torrentreactor: 1.35 torrentreactor: 1.36
mininova: 2.00 mininova: 2.00
piratebay: 2.11 piratebay: 2.11
extratorrent: 2.0 extratorrent: 2.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 951 B

Before After
Before After

View file

@ -1,4 +1,4 @@
#VERSION: 1.35 #VERSION: 1.36
#AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net) #AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net)
#CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org) #CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org)
# Bruno Barbieri (brunorex@gmail.com) # Bruno Barbieri (brunorex@gmail.com)
@ -32,11 +32,11 @@ from helpers import download_file
from urllib import parse from urllib import parse
from html.parser import HTMLParser from html.parser import HTMLParser
from http.client import HTTPConnection as http from http.client import HTTPConnection as http
import re from re import compile as re_compile
class torrentreactor(object): class torrentreactor(object):
url = 'http://www.torrentreactor.net' url = 'http://www.torrentreactor.net'
name = 'TorrentReactor.Net' name = 'TorrentReactor'
supported_categories = {'all': '', 'movies': '5', 'tv': '8', 'music': '6', 'games': '3', 'anime': '1', 'software': '2'} supported_categories = {'all': '', 'movies': '5', 'tv': '8', 'music': '6', 'games': '3', 'anime': '1', 'software': '2'}
def download_torrent(self, info): def download_torrent(self, info):
@ -50,6 +50,7 @@ class torrentreactor(object):
self.results = results self.results = results
self.id = None self.id = None
self.url = url self.url = url
self.torrents_matcher = re_compile("/torrents/\d+.*")
self.dispatcher = { 'a' : self.start_a, 'td' : self.start_td } self.dispatcher = { 'a' : self.start_a, 'td' : self.start_td }
def handle_starttag(self, tag, attrs): def handle_starttag(self, tag, attrs):
@ -58,7 +59,7 @@ class torrentreactor(object):
def start_a(self, attr): def start_a(self, attr):
params = dict(attr) params = dict(attr)
if re.match("/torrents/\d+.*", params['href']): if self.torrents_matcher.match(params['href']):
self.current_item = {} self.current_item = {}
self.current_item['desc_link'] = self.url+params['href'].strip() self.current_item['desc_link'] = self.url+params['href'].strip()
elif 'torrentreactor.net/download.php' in params['href']: elif 'torrentreactor.net/download.php' in params['href']:

View file

@ -1,5 +1,5 @@
extratorrent: 1.2 extratorrent: 1.2
torrentreactor: 1.35 torrentreactor: 1.36
mininova: 2.00 mininova: 2.00
piratebay: 2.11 piratebay: 2.11
extratorrent: 2.0 extratorrent: 2.0