diff --git a/TODO b/TODO index 82f3415c5..e284e92eb 100644 --- a/TODO +++ b/TODO @@ -50,7 +50,7 @@ - valgrind --tool=memcheck --leak-check=full src/qbittorrent (Looks ok) - 128m 29m 16m S 4.8 2.9 0:02.28 qbittorrent * beta 6 - - Fix Qt4.2 compatibility (download.ui) + - Fix Qt4.2 compatibility (toolbar) - Fix meganova search engine - Translations update (IN PROGRESS) - Wait for some bug fixes in libtorrent : @@ -79,6 +79,7 @@ beta5->beta6 changelog: - FEATURE: Split download tab from GUI class and cleaned up code - FEATURE: A lot of code optimization (CPU & memory usage) - FEATURE: Added support for .ico format (useful for RSS favicons) +- FEATURE: Replaced Meganova search engine by TorrentReactor - I18N: Updated Greek translation - BUGFIX: Made torrent deletion from hard-drive safer - BUGFIX: Fixed a bug when switching from finished to downloading list diff --git a/src/search.ui b/src/search.ui index 5822f0595..c83dbc0df 100644 --- a/src/search.ui +++ b/src/search.ui @@ -76,7 +76,7 @@ - + diff --git a/src/searchEngine.cpp b/src/searchEngine.cpp index acd5b4e6b..189dc38af 100644 --- a/src/searchEngine.cpp +++ b/src/searchEngine.cpp @@ -87,7 +87,7 @@ SearchEngine::SearchEngine(bittorrent *BTSession, QSystemTrayIcon *myTrayIcon, b // reactor->setText("TorrentReactor"); isohunt->setText("Isohunt"); // btjunkie->setText("BTJunkie"); - meganova->setText("Meganova"); + reactor->setText("TorrentReactor"); // Check last checked search engines loadCheckedSearchEngines(); connect(mininova, SIGNAL(stateChanged(int)), this, SLOT(saveCheckedSearchEngines(int))); @@ -95,7 +95,7 @@ SearchEngine::SearchEngine(bittorrent *BTSession, QSystemTrayIcon *myTrayIcon, b // connect(reactor, SIGNAL(stateChanged(int)), this, SLOT(saveCheckedSearchEngines(int))); connect(isohunt, SIGNAL(stateChanged(int)), this, SLOT(saveCheckedSearchEngines(int))); // connect(btjunkie, SIGNAL(stateChanged(int)), this, SLOT(saveCheckedSearchEngines(int))); - connect(meganova, SIGNAL(stateChanged(int)), this, SLOT(saveCheckedSearchEngines(int))); + connect(reactor, SIGNAL(stateChanged(int)), this, SLOT(saveCheckedSearchEngines(int))); // Update nova.py search plugin if necessary updateNova(); } @@ -190,7 +190,7 @@ void SearchEngine::saveCheckedSearchEngines(int) const{ settings.setValue("mininova", mininova->isChecked()); settings.setValue("piratebay", piratebay->isChecked()); settings.setValue("isohunt", isohunt->isChecked()); - settings.setValue("meganova", meganova->isChecked()); + settings.setValue("reactor", reactor->isChecked()); settings.endGroup(); qDebug("Saved checked search engines"); } @@ -234,7 +234,7 @@ void SearchEngine::loadCheckedSearchEngines(){ mininova->setChecked(settings.value("mininova", true).toBool()); piratebay->setChecked(settings.value("piratebay", false).toBool()); isohunt->setChecked(settings.value("isohunt", false).toBool()); - meganova->setChecked(settings.value("meganova", false).toBool()); + reactor->setChecked(settings.value("reactor", false).toBool()); settings.endGroup(); qDebug("Loaded checked search engines"); } @@ -282,7 +282,7 @@ void SearchEngine::on_search_button_clicked(){ // Getting checked search engines - if(!mininova->isChecked() && ! piratebay->isChecked()/* && !reactor->isChecked()*/ && !isohunt->isChecked()/* && !btjunkie->isChecked()*/ && !meganova->isChecked()){ + if(!mininova->isChecked() && ! piratebay->isChecked() && !reactor->isChecked() && !isohunt->isChecked()/* && !btjunkie->isChecked()*/ /*&& !meganova->isChecked()*/){ QMessageBox::critical(0, tr("No search engine selected"), tr("You must select at least one search engine.")); return; } @@ -305,8 +305,8 @@ void SearchEngine::on_search_button_clicked(){ // if(btjunkie->isChecked()){ // engineNames << "btjunkie"; // } - if(meganova->isChecked()){ - engineNames << "meganova"; + if(reactor->isChecked()){ + engineNames << "reactor"; } params << engineNames.join(","); params << pattern.split(" "); diff --git a/src/search_engine/nova.py b/src/search_engine/nova.py index 1da67f5e2..47a798fe7 100755 --- a/src/search_engine/nova.py +++ b/src/search_engine/nova.py @@ -1,5 +1,9 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +# Version: 2.04 +# Changelog: +# - Fixed TorrentReactor search engine + # Version: 2.03 # Changelog: # - Little fix for mininova search engine when file name contain '<=' @@ -55,7 +59,7 @@ import cgi import traceback import threading -STANDALONE = True +STANDALONE = False THREADED = True if os.environ.has_key('QBITTORRENT'): @@ -274,11 +278,11 @@ class MegaNova(object): url = 'http://www.meganova.org' def search(self, what): - dat = urllib.urlopen(self.url+'/find-seeds/%s.html'%what).read().decode('utf8', 'replace') - print 'url is ' + self.url+'/find-seeds/%s.html'%what + dat = urllib.urlopen(self.url+'/find/%s/4/1.html'%what).read().decode('utf8', 'replace') + print 'url is ' + self.url+'/find/%s/4/1.html'%what # I know it's not very readable, but the SGML parser feels in pain - section_re = re.compile('(?s).*?/torrent/.*?)".*?' '(?P.*?).*?' '>(?P[0-9.]+\s+.B).*?' @@ -296,7 +300,7 @@ class MegaNova(object): prettyPrinter(torrent_infos) class Reactor(object): - url = 'http://tr.searching.com' + url = 'http://www.torrentreactor.net' class SimpleSGMLParser(sgmllib.SGMLParser): def __init__(self, results, url, *args): @@ -309,13 +313,12 @@ class Reactor(object): def start_a(self, attr): params = dict(attr) - if params['href'].startswith('view.php'): + if params['href'].startswith('http://dl.torrentreactor.net/download.php'): self.current_item = {} self.td_counter = 0 - # extract the torrent id - #I save it in a global variable for after create the link string equal = params['href'].find("=") - self.id = str(int(params['href'][equal+1:])) + amp = params['href'].find("&", equal+1) + self.id = str(int(params['href'][equal+1:amp])) def handle_data(self, data): if self.td_counter == 0: @@ -342,7 +345,7 @@ class Reactor(object): self.td_counter = None # add item to results if self.current_item: - self.current_item['link']='http://download.torrentreactor.net/download.php?name=%s&id=%s'%(cgi.escape(self.current_item['name']),self.id) + self.current_item['link']='http://download.torrentreactor.net/download.php?id=%s&name=%s'%(self.id, urllib.quote(self.current_item['name'])) self.current_item['engine_url'] = self.url self.current_item['size']= anySizeToBytes(self.current_item['size']) if not self.current_item['seeds'].isdigit(): @@ -362,7 +365,7 @@ class Reactor(object): while True: results = [] parser = self.SimpleSGMLParser(results, self.url) - dat = urllib.urlopen(self.url+'/search.php?search=&words=%s&skip=%s'%(what,(i*50))).read().decode('utf-8', 'replace') + dat = urllib.urlopen(self.url+'/search.php?search=&words=%s&cid=&sid=&type=2&orderby=a.seeds&asc=0&skip=%s'%(what,(i*35))).read().decode('utf-8', 'replace') parser.feed(dat) parser.close() if len(results) <= 0: