mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
Allow to enter only info-hashes in the download dialog.
This commit is contained in:
parent
f8fdd58e20
commit
0ea8fd6996
3 changed files with 29 additions and 4 deletions
|
@ -1182,13 +1182,20 @@ void MainWindow::downloadFromURLList(const QStringList& url_list) {
|
|||
qDebug("Converting bc link to magnet link");
|
||||
url = misc::bcLinkToMagnet(url);
|
||||
}
|
||||
if ((url.size() == 40 && !url.contains(QRegExp("[^0-9A-Fa-f]")))
|
||||
|| (url.size() == 32 && !url.contains(QRegExp("[^2-7A-Za-z]")))) {
|
||||
url = "magnet:?xt=urn:btih:" + url;
|
||||
}
|
||||
if (url.startsWith("magnet:", Qt::CaseInsensitive)) {
|
||||
if (useTorrentAdditionDialog)
|
||||
AddNewTorrentDialog::showMagnet(url);
|
||||
else
|
||||
QBtSession::instance()->addMagnetUri(url);
|
||||
} else
|
||||
}
|
||||
else if (url.startsWith("http://", Qt::CaseInsensitive) || startsWith("https://", Qt::CaseInsensitive)
|
||||
|| url.startsWith("ftp://", Qt::CaseInsensitive)) {
|
||||
QBtSession::instance()->downloadFromUrl(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue