mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 14:12:30 -06:00
Compare commits
18 Commits
release-1.
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
603b14dd4c | ||
|
|
faa33b0d7e | ||
|
|
8fdf3d520c | ||
|
|
b238a4ed69 | ||
|
|
ba53bdc708 | ||
|
|
f2a65e07b5 | ||
|
|
62afd4f98b | ||
|
|
6c11fd5a0d | ||
|
|
cc39504a61 | ||
|
|
1baec5378f | ||
|
|
b60b4fafff | ||
|
|
3325dd0550 | ||
|
|
29dc0fede0 | ||
|
|
19f6b8491e | ||
|
|
01b1e78dcd | ||
|
|
bd546e3d18 | ||
|
|
6ca93dfbae | ||
|
|
f175ce5249 |
16
TODO
16
TODO
@@ -53,11 +53,11 @@
|
|||||||
TODO:
|
TODO:
|
||||||
- Check search engine cpu usage
|
- Check search engine cpu usage
|
||||||
|
|
||||||
rc9->rc10 changelog:
|
rc10->rc11? changelog:
|
||||||
- FEATURE: Greatly improved ETA calculation algorithm (use GASA)
|
- BUGFIX: Bypass exit confirmation on system shutdown
|
||||||
- BUGFIX: Fixed proxy host max length in preferences
|
- BUGFIX: Download from urls are now able to follow redirections
|
||||||
- BUGFIX: Added a 3 minutes search engine timeout
|
- BUGFIX: Clean up for failed torrents downloaded from urls
|
||||||
- BUGFIX: Limit search engine plugins to 10 result pages
|
- BUGFIX: Fixed downloads from URLs on Windows
|
||||||
- BUGFIX: Fixed nbResults != 0 when clearing results while a search is running
|
- BUGFIX: Fixed search engine on Windows
|
||||||
- BUGFIX: Fixed possible problem when closing to systray and cancelling app exit
|
- BUGFIX: Fixed torrent creation from a directory
|
||||||
- COSMETIC: Use more skin colors instead of hard coded ones
|
- BUGFIX: Fixed save path when seeding automatically after torrent creation
|
||||||
|
|||||||
25
src/GUI.cpp
25
src/GUI.cpp
@@ -392,10 +392,10 @@ void GUI::on_actionExit_triggered() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GUI::previewFile(QString filePath) {
|
void GUI::previewFile(QString filePath) {
|
||||||
QDesktopServices::openUrl(filePath);
|
QDesktopServices::openUrl(QString("file://")+filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int GUI::getCurrentTabIndex() const{
|
int GUI::getCurrentTabIndex() const{
|
||||||
if(isMinimized() || isHidden())
|
if(isMinimized() || isHidden())
|
||||||
return -1;
|
return -1;
|
||||||
return tabs->currentIndex();
|
return tabs->currentIndex();
|
||||||
@@ -449,7 +449,7 @@ void GUI::on_actionAbout_triggered() {
|
|||||||
|
|
||||||
// Called when we close the program
|
// Called when we close the program
|
||||||
void GUI::closeEvent(QCloseEvent *e) {
|
void GUI::closeEvent(QCloseEvent *e) {
|
||||||
qDebug("Mainwindow received closeEvent");
|
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
bool goToSystrayOnExit = settings.value(QString::fromUtf8("Preferences/General/CloseToTray"), false).toBool();
|
bool goToSystrayOnExit = settings.value(QString::fromUtf8("Preferences/General/CloseToTray"), false).toBool();
|
||||||
if(!force_exit && systrayIntegration && goToSystrayOnExit && !this->isHidden()) {
|
if(!force_exit && systrayIntegration && goToSystrayOnExit && !this->isHidden()) {
|
||||||
@@ -461,14 +461,16 @@ void GUI::closeEvent(QCloseEvent *e) {
|
|||||||
show();
|
show();
|
||||||
if(!isMaximized())
|
if(!isMaximized())
|
||||||
showNormal();
|
showNormal();
|
||||||
if(QMessageBox::question(this,
|
if(e->spontaneous() == true || force_exit == true) {
|
||||||
tr("Are you sure you want to quit?")+QString::fromUtf8(" -- ")+tr("qBittorrent"),
|
if(QMessageBox::question(this,
|
||||||
tr("The download list is not empty.\nAre you sure you want to quit qBittorrent?"),
|
tr("Are you sure you want to quit?")+QString::fromUtf8(" -- ")+tr("qBittorrent"),
|
||||||
tr("&Yes"), tr("&No"),
|
tr("The download list is not empty.\nAre you sure you want to quit qBittorrent?"),
|
||||||
QString(), 0, 1)) {
|
tr("&Yes"), tr("&No"),
|
||||||
e->ignore();
|
QString(), 0, 1)) {
|
||||||
force_exit = false;
|
e->ignore();
|
||||||
return;
|
force_exit = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hide();
|
hide();
|
||||||
@@ -486,6 +488,7 @@ void GUI::closeEvent(QCloseEvent *e) {
|
|||||||
qApp->exit();
|
qApp->exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Display window to create a torrent
|
// Display window to create a torrent
|
||||||
void GUI::on_actionCreate_torrent_triggered() {
|
void GUI::on_actionCreate_torrent_triggered() {
|
||||||
createtorrent *ct = new createtorrent(this);
|
createtorrent *ct = new createtorrent(this);
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||||||
GUI(QWidget *parent=0, QStringList torrentCmdLine=QStringList());
|
GUI(QWidget *parent=0, QStringList torrentCmdLine=QStringList());
|
||||||
~GUI();
|
~GUI();
|
||||||
// Methods
|
// Methods
|
||||||
unsigned int getCurrentTabIndex() const;
|
int getCurrentTabIndex() const;
|
||||||
QPoint screenCenter() const;
|
QPoint screenCenter() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -519,6 +519,7 @@ void bittorrent::addTorrent(QString path, bool fromScanDir, QString from_url, bo
|
|||||||
// Display warning to tell user we can't decode the torrent file
|
// Display warning to tell user we can't decode the torrent file
|
||||||
if(!from_url.isNull()) {
|
if(!from_url.isNull()) {
|
||||||
emit invalidTorrent(from_url);
|
emit invalidTorrent(from_url);
|
||||||
|
QFile::remove(file);
|
||||||
}else{
|
}else{
|
||||||
emit invalidTorrent(file);
|
emit invalidTorrent(file);
|
||||||
}
|
}
|
||||||
@@ -533,6 +534,8 @@ void bittorrent::addTorrent(QString path, bool fromScanDir, QString from_url, bo
|
|||||||
// Display warning to tell user we can't decode the torrent file
|
// Display warning to tell user we can't decode the torrent file
|
||||||
if(!from_url.isNull()) {
|
if(!from_url.isNull()) {
|
||||||
emit invalidTorrent(from_url);
|
emit invalidTorrent(from_url);
|
||||||
|
qDebug("File path is: %s", file.toUtf8().data());
|
||||||
|
QFile::remove(file);
|
||||||
}else{
|
}else{
|
||||||
emit invalidTorrent(file);
|
emit invalidTorrent(file);
|
||||||
}
|
}
|
||||||
@@ -753,7 +756,7 @@ void bittorrent::loadFilesPriorities(QTorrentHandle &h) {
|
|||||||
if( priority < 0 || priority > 7) {
|
if( priority < 0 || priority > 7) {
|
||||||
priority = 1;
|
priority = 1;
|
||||||
}
|
}
|
||||||
//qDebug("Setting piece piority to %d", priority);
|
qDebug("Setting piece piority to %d", priority);
|
||||||
v.push_back(priority);
|
v.push_back(priority);
|
||||||
}
|
}
|
||||||
h.prioritize_files(v);
|
h.prioritize_files(v);
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include <libtorrent/file_pool.hpp>
|
#include <libtorrent/file_pool.hpp>
|
||||||
|
|
||||||
#include "createtorrent_imp.h"
|
#include "createtorrent_imp.h"
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
using namespace boost::filesystem;
|
using namespace boost::filesystem;
|
||||||
@@ -120,11 +121,13 @@ void createtorrent::on_addURLSeed_button_clicked(){
|
|||||||
// Subfunction to add files to a torrent_info structure
|
// Subfunction to add files to a torrent_info structure
|
||||||
// Written by Arvid Norberg (libtorrent Author)
|
// Written by Arvid Norberg (libtorrent Author)
|
||||||
void add_files(torrent_info& t, path const& p, path const& l){
|
void add_files(torrent_info& t, path const& p, path const& l){
|
||||||
|
qDebug("p: %s, l: %s, l.leaf(): %s", p.string().c_str(), l.string().c_str(), l.leaf().c_str());
|
||||||
path f(p / l);
|
path f(p / l);
|
||||||
if (is_directory(f)){
|
if (is_directory(f)){
|
||||||
for (directory_iterator i(f), end; i != end; ++i)
|
for (directory_iterator i(f), end; i != end; ++i)
|
||||||
add_files(t, p, l / i->leaf());
|
add_files(t, p, l / i->leaf());
|
||||||
}else{
|
}else{
|
||||||
|
qDebug("Adding %s", l.string().c_str());
|
||||||
t.add_file(l, file_size(f));
|
t.add_file(l, file_size(f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,6 +144,8 @@ QStringList createtorrent::allItems(QListWidget *list){
|
|||||||
// Main function that create a .torrent file
|
// Main function that create a .torrent file
|
||||||
void createtorrent::on_createButton_clicked(){
|
void createtorrent::on_createButton_clicked(){
|
||||||
QString input = textInputPath->text().trimmed();
|
QString input = textInputPath->text().trimmed();
|
||||||
|
if (input.endsWith(QDir::separator()))
|
||||||
|
input.chop(1);
|
||||||
if(input.isEmpty()){
|
if(input.isEmpty()){
|
||||||
QMessageBox::critical(0, tr("No input path set"), tr("Please type an input path first"));
|
QMessageBox::critical(0, tr("No input path set"), tr("Please type an input path first"));
|
||||||
return;
|
return;
|
||||||
@@ -161,9 +166,8 @@ void createtorrent::on_createButton_clicked(){
|
|||||||
try {
|
try {
|
||||||
boost::intrusive_ptr<torrent_info> t(new torrent_info);
|
boost::intrusive_ptr<torrent_info> t(new torrent_info);
|
||||||
ofstream out(complete(path((const char*)destination.toUtf8())), std::ios_base::binary);
|
ofstream out(complete(path((const char*)destination.toUtf8())), std::ios_base::binary);
|
||||||
path full_path;
|
|
||||||
// Adding files to the torrent
|
// Adding files to the torrent
|
||||||
full_path = complete(path(input.toUtf8().data()));
|
path full_path = complete(path(input.toUtf8().data()));
|
||||||
add_files(*t, full_path.branch_path(), full_path.leaf());
|
add_files(*t, full_path.branch_path(), full_path.leaf());
|
||||||
// Set piece size
|
// Set piece size
|
||||||
int piece_size = getPieceSize();
|
int piece_size = getPieceSize();
|
||||||
@@ -200,8 +204,14 @@ void createtorrent::on_createButton_clicked(){
|
|||||||
entry e = t->create_torrent();
|
entry e = t->create_torrent();
|
||||||
libtorrent::bencode(std::ostream_iterator<char>(out), e);
|
libtorrent::bencode(std::ostream_iterator<char>(out), e);
|
||||||
out.flush();
|
out.flush();
|
||||||
if(checkStartSeeding->isChecked())
|
if(checkStartSeeding->isChecked()) {
|
||||||
|
// Create save path file
|
||||||
|
QFile savepath_file(misc::qBittorrentPath()+QString::fromUtf8("BT_backup")+QDir::separator()+misc::toQString(t->info_hash())+QString::fromUtf8(".savepath"));
|
||||||
|
savepath_file.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||||
|
savepath_file.write(full_path.branch_path().string().c_str());
|
||||||
|
savepath_file.close();
|
||||||
emit torrent_to_seed(destination);
|
emit torrent_to_seed(destination);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (std::exception& e){
|
catch (std::exception& e){
|
||||||
std::cerr << e.what() << "\n";
|
std::cerr << e.what() << "\n";
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ void subDownloadThread::run(){
|
|||||||
filePath = tmpfile->fileName();
|
filePath = tmpfile->fileName();
|
||||||
}
|
}
|
||||||
delete tmpfile;
|
delete tmpfile;
|
||||||
FILE *f = fopen(filePath.toUtf8().data(), "w");
|
FILE *f = fopen(filePath.toUtf8().data(), "wb");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
std::cerr << "couldn't open destination file" << "\n";
|
std::cerr << "couldn't open destination file" << "\n";
|
||||||
return;
|
return;
|
||||||
@@ -112,6 +112,14 @@ void subDownloadThread::run(){
|
|||||||
// We have to define CURLOPT_WRITEFUNCTION or it will crash on windows
|
// We have to define CURLOPT_WRITEFUNCTION or it will crash on windows
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
|
||||||
|
// Verbose
|
||||||
|
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||||
|
// No progress info (we don't use it)
|
||||||
|
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
|
||||||
|
// Redirections
|
||||||
|
curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, -1);
|
||||||
qDebug("Downloading %s", url.toUtf8().data());
|
qDebug("Downloading %s", url.toUtf8().data());
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
/* always cleanup */
|
/* always cleanup */
|
||||||
|
|||||||
@@ -250,11 +250,13 @@ void engineSelectDlg::setRowColor(int row, QString color){
|
|||||||
bool engineSelectDlg::checkInstalled(QString plugin_name) const {
|
bool engineSelectDlg::checkInstalled(QString plugin_name) const {
|
||||||
QProcess nova;
|
QProcess nova;
|
||||||
QStringList params;
|
QStringList params;
|
||||||
|
params << misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py";
|
||||||
params << "--supported_engines";
|
params << "--supported_engines";
|
||||||
nova.start(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py", params, QIODevice::ReadOnly);
|
nova.start("python", params, QIODevice::ReadOnly);
|
||||||
nova.waitForStarted();
|
nova.waitForStarted();
|
||||||
nova.waitForFinished();
|
nova.waitForFinished();
|
||||||
QByteArray result = nova.readAll();
|
QByteArray result = nova.readAll();
|
||||||
|
result = result.replace("\r", "");
|
||||||
result = result.replace("\n", "");
|
result = result.replace("\n", "");
|
||||||
QList<QByteArray> plugins_list = result.split(',');
|
QList<QByteArray> plugins_list = result.split(',');
|
||||||
return plugins_list.contains(plugin_name.toUtf8());
|
return plugins_list.contains(plugin_name.toUtf8());
|
||||||
@@ -280,11 +282,13 @@ void engineSelectDlg::loadSupportedSearchEngines(bool first) {
|
|||||||
QStringList params;
|
QStringList params;
|
||||||
// Ask nova core for the supported search engines
|
// Ask nova core for the supported search engines
|
||||||
QProcess nova;
|
QProcess nova;
|
||||||
|
params << misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py";
|
||||||
params << "--supported_engines";
|
params << "--supported_engines";
|
||||||
nova.start(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py", params, QIODevice::ReadOnly);
|
nova.start("python", params, QIODevice::ReadOnly);
|
||||||
nova.waitForStarted();
|
nova.waitForStarted();
|
||||||
nova.waitForFinished();
|
nova.waitForFinished();
|
||||||
QByteArray result = nova.readAll();
|
QByteArray result = nova.readAll();
|
||||||
|
result = result.replace("\r", "");
|
||||||
result = result.replace("\n", "");
|
result = result.replace("\n", "");
|
||||||
qDebug("read: %s", result.data());
|
qDebug("read: %s", result.data());
|
||||||
QByteArray e;
|
QByteArray e;
|
||||||
@@ -295,11 +299,13 @@ void engineSelectDlg::loadSupportedSearchEngines(bool first) {
|
|||||||
installed_engines[en] = old_engines.value(en, true);
|
installed_engines[en] = old_engines.value(en, true);
|
||||||
}
|
}
|
||||||
params.clear();
|
params.clear();
|
||||||
|
params << misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py";
|
||||||
params << "--supported_engines_infos";
|
params << "--supported_engines_infos";
|
||||||
nova.start(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py", params, QIODevice::ReadOnly);
|
nova.start("python", params, QIODevice::ReadOnly);
|
||||||
nova.waitForStarted();
|
nova.waitForStarted();
|
||||||
nova.waitForFinished();
|
nova.waitForFinished();
|
||||||
result = nova.readAll();
|
result = nova.readAll();
|
||||||
|
result = result.replace("\r", "");
|
||||||
result = result.replace("\n", "");
|
result = result.replace("\n", "");
|
||||||
qDebug("read: %s", result.data());
|
qDebug("read: %s", result.data());
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ void SearchEngine::on_search_button_clicked(){
|
|||||||
QStringList params;
|
QStringList params;
|
||||||
QStringList engineNames;
|
QStringList engineNames;
|
||||||
search_stopped = false;
|
search_stopped = false;
|
||||||
|
params << misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py";
|
||||||
params << enabled_engines.join(",");
|
params << enabled_engines.join(",");
|
||||||
params << pattern.split(" ");
|
params << pattern.split(" ");
|
||||||
// Update SearchEngine widgets
|
// Update SearchEngine widgets
|
||||||
@@ -286,7 +286,7 @@ void SearchEngine::on_search_button_clicked(){
|
|||||||
search_result_line_truncated.clear();
|
search_result_line_truncated.clear();
|
||||||
results_lbl->setText(tr("Results")+" <i>(0)</i>:");
|
results_lbl->setText(tr("Results")+" <i>(0)</i>:");
|
||||||
// Launch search
|
// Launch search
|
||||||
searchProcess->start(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py", params, QIODevice::ReadOnly);
|
searchProcess->start("python", params, QIODevice::ReadOnly);
|
||||||
searchTimeout->start(180000); // 3min
|
searchTimeout->start(180000); // 3min
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,6 +318,7 @@ void SearchEngine::downloadSelectedItem(const QModelIndex& index){
|
|||||||
// line to search results calling appendSearchResult().
|
// line to search results calling appendSearchResult().
|
||||||
void SearchEngine::readSearchOutput(){
|
void SearchEngine::readSearchOutput(){
|
||||||
QByteArray output = searchProcess->readAllStandardOutput();
|
QByteArray output = searchProcess->readAllStandardOutput();
|
||||||
|
output.replace("\r", "");
|
||||||
QList<QByteArray> lines_list = output.split('\n');
|
QList<QByteArray> lines_list = output.split('\n');
|
||||||
QByteArray line;
|
QByteArray line;
|
||||||
if(!search_result_line_truncated.isEmpty()){
|
if(!search_result_line_truncated.isEmpty()){
|
||||||
@@ -370,7 +371,7 @@ void SearchEngine::updateNova() {
|
|||||||
QStringList files = shipped_subDir.entryList();
|
QStringList files = shipped_subDir.entryList();
|
||||||
QString file;
|
QString file;
|
||||||
foreach(file, files){
|
foreach(file, files){
|
||||||
QString shipped_file = shipped_subDir.path()+QDir::separator()+file;
|
QString shipped_file = shipped_subDir.path()+"/"+file;
|
||||||
// Copy python classes
|
// Copy python classes
|
||||||
if(file.endsWith(".py")) {
|
if(file.endsWith(".py")) {
|
||||||
if(misc::getPluginVersion(shipped_file) > misc::getPluginVersion(destDir+file) ) {
|
if(misc::getPluginVersion(shipped_file) > misc::getPluginVersion(destDir+file) ) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#VERSION: 1.11
|
#VERSION: 1.12
|
||||||
#AUTHORS: Fabien Devaux (fab@gnux.info)
|
#AUTHORS: Fabien Devaux (fab@gnux.info)
|
||||||
from novaprinter import prettyPrinter
|
from novaprinter import prettyPrinter
|
||||||
import urllib
|
import urllib
|
||||||
@@ -14,7 +14,7 @@ class btjunkie(object):
|
|||||||
res = 0
|
res = 0
|
||||||
dat = urllib.urlopen(self.url+'/search?q=%s&o=52&p=%d'%(what,i)).read().decode('utf8', 'replace')
|
dat = urllib.urlopen(self.url+'/search?q=%s&o=52&p=%d'%(what,i)).read().decode('utf8', 'replace')
|
||||||
# I know it's not very readable, but the SGML parser feels in pain
|
# I know it's not very readable, but the SGML parser feels in pain
|
||||||
section_re = re.compile('(?s)href="/torrent.*?<tr>')
|
section_re = re.compile('(?s)href="http://dl.btjunkie.org/torrent/.*?<tr>')
|
||||||
torrent_re = re.compile('(?s)href="(?P<link>.*?[^"]+).*?'
|
torrent_re = re.compile('(?s)href="(?P<link>.*?[^"]+).*?'
|
||||||
'class="BlckUnd">(?P<name>.*?)</a>.*?'
|
'class="BlckUnd">(?P<name>.*?)</a>.*?'
|
||||||
'>(?P<size>\d+MB)</font>.*?'
|
'>(?P<size>\d+MB)</font>.*?'
|
||||||
@@ -27,7 +27,7 @@ class btjunkie(object):
|
|||||||
torrent_infos = m.groupdict()
|
torrent_infos = m.groupdict()
|
||||||
torrent_infos['name'] = re.sub('</?font.*?>', '', torrent_infos['name'])
|
torrent_infos['name'] = re.sub('</?font.*?>', '', torrent_infos['name'])
|
||||||
torrent_infos['engine_url'] = self.url
|
torrent_infos['engine_url'] = self.url
|
||||||
torrent_infos['link'] = self.url+torrent_infos['link']
|
#torrent_infos['link'] = self.url+torrent_infos['link']
|
||||||
prettyPrinter(torrent_infos)
|
prettyPrinter(torrent_infos)
|
||||||
res = res + 1
|
res = res + 1
|
||||||
if res == 0:
|
if res == 0:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#VERSION: 1.01
|
#VERSION: 1.02
|
||||||
#AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net)
|
#AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net)
|
||||||
from novaprinter import prettyPrinter
|
from novaprinter import prettyPrinter
|
||||||
import sgmllib
|
import sgmllib
|
||||||
@@ -22,9 +22,7 @@ class torrentreactor(object):
|
|||||||
if params['href'].startswith('http://dl.torrentreactor.net/download.php'):
|
if params['href'].startswith('http://dl.torrentreactor.net/download.php'):
|
||||||
self.current_item = {}
|
self.current_item = {}
|
||||||
self.td_counter = 0
|
self.td_counter = 0
|
||||||
equal = params['href'].find("=")
|
self.current_item['link'] = params['href'].strip()
|
||||||
amp = params['href'].find("&", equal+1)
|
|
||||||
self.id = str(int(params['href'][equal+1:amp]))
|
|
||||||
|
|
||||||
def handle_data(self, data):
|
def handle_data(self, data):
|
||||||
if self.td_counter == 0:
|
if self.td_counter == 0:
|
||||||
@@ -47,11 +45,10 @@ class torrentreactor(object):
|
|||||||
def start_td(self,attr):
|
def start_td(self,attr):
|
||||||
if isinstance(self.td_counter,int):
|
if isinstance(self.td_counter,int):
|
||||||
self.td_counter += 1
|
self.td_counter += 1
|
||||||
if self.td_counter > 7:
|
if self.td_counter > 3:
|
||||||
self.td_counter = None
|
self.td_counter = None
|
||||||
# add item to results
|
# add item to results
|
||||||
if self.current_item:
|
if self.current_item:
|
||||||
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['engine_url'] = self.url
|
||||||
if not self.current_item['seeds'].isdigit():
|
if not self.current_item['seeds'].isdigit():
|
||||||
self.current_item['seeds'] = 0
|
self.current_item['seeds'] = 0
|
||||||
@@ -71,6 +68,7 @@ class torrentreactor(object):
|
|||||||
results = []
|
results = []
|
||||||
parser = self.SimpleSGMLParser(results, self.url)
|
parser = self.SimpleSGMLParser(results, self.url)
|
||||||
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')
|
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')
|
||||||
|
#print "loading page: "+self.url+'/search.php?search=&words=%s&cid=&sid=&type=2&orderby=a.seeds&asc=0&skip=%s'%(what,(i*35))
|
||||||
parser.feed(dat)
|
parser.feed(dat)
|
||||||
parser.close()
|
parser.close()
|
||||||
if len(results) <= 0:
|
if len(results) <= 0:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
isohunt: 1.01
|
isohunt: 1.01
|
||||||
torrentreactor: 1.01
|
torrentreactor: 1.02
|
||||||
btjunkie: 1.11
|
btjunkie: 1.12
|
||||||
mininova: 1.12
|
mininova: 1.12
|
||||||
piratebay: 1.01
|
piratebay: 1.01
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ TARGET = qbittorrent
|
|||||||
CONFIG += qt thread x11 network
|
CONFIG += qt thread x11 network
|
||||||
|
|
||||||
# Update this VERSION for each release
|
# Update this VERSION for each release
|
||||||
DEFINES += VERSION=\\\"v1.0.0rc9\\\"
|
DEFINES += VERSION=\\\"v1.0.0rc11\\\"
|
||||||
DEFINES += VERSION_MAJOR=1
|
DEFINES += VERSION_MAJOR=1
|
||||||
DEFINES += VERSION_MINOR=0
|
DEFINES += VERSION_MINOR=0
|
||||||
DEFINES += VERSION_BUGFIX=0
|
DEFINES += VERSION_BUGFIX=0
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
|
|||||||
// Display warning to tell user we can't decode the torrent file
|
// Display warning to tell user we can't decode the torrent file
|
||||||
if(!from_url.isNull()){
|
if(!from_url.isNull()){
|
||||||
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+from_url+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+from_url+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
||||||
|
QFile::remove(filePath);
|
||||||
}else{
|
}else{
|
||||||
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+filePath+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+filePath+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
||||||
}
|
}
|
||||||
@@ -142,9 +143,11 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
|
|||||||
// Display warning to tell user we can't decode the torrent file
|
// Display warning to tell user we can't decode the torrent file
|
||||||
if(!from_url.isNull()){
|
if(!from_url.isNull()){
|
||||||
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+from_url+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+from_url+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
||||||
|
QFile::remove(filePath);
|
||||||
}else{
|
}else{
|
||||||
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+filePath+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+filePath+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
||||||
}
|
}
|
||||||
|
qDebug("path is %s", filePath.toUtf8().data());
|
||||||
emit setInfoBarGUI(tr("This file is either corrupted or this isn't a torrent."), QString::fromUtf8("red"));
|
emit setInfoBarGUI(tr("This file is either corrupted or this isn't a torrent."), QString::fromUtf8("red"));
|
||||||
if(fromScanDir){
|
if(fromScanDir){
|
||||||
// Remove .corrupt file in case it already exists
|
// Remove .corrupt file in case it already exists
|
||||||
|
|||||||
Reference in New Issue
Block a user