1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-24 05:25:37 +00:00

[Web UI] Torrent download from hash. Closes #1173

This commit is contained in:
ngosang 2015-07-09 09:59:34 +02:00
parent 647140c7c7
commit f0d32e2cde

View File

@ -313,7 +313,9 @@ void WebApplication::action_command_download()
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;
BitTorrent::Session::instance()->addTorrent(url);
}
}