mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Create MagnetUri object from BC link or HASH string
This commit is contained in:
parent
f23cd9204c
commit
c57aaf0216
9 changed files with 71 additions and 79 deletions
|
@ -354,14 +354,6 @@ void WebApplication::action_command_download()
|
|||
foreach (QString url, list) {
|
||||
url = url.trimmed();
|
||||
if (!url.isEmpty()) {
|
||||
if (url.startsWith("bc://bt/", Qt::CaseInsensitive)) {
|
||||
qDebug("Converting bc link to magnet link");
|
||||
url = Utils::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;
|
||||
|
||||
Net::DownloadManager::instance()->setCookiesFromUrl(cookies, QUrl::fromEncoded(url.toUtf8()));
|
||||
BitTorrent::Session::instance()->addTorrent(url, params);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue