Browse Source

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

adaptive-webui-19844
ngosang 10 years ago
parent
commit
f0d32e2cde
  1. 4
      src/webui/webapplication.cpp

4
src/webui/webapplication.cpp

@ -313,7 +313,9 @@ void WebApplication::action_command_download()
qDebug("Converting bc link to magnet link"); qDebug("Converting bc link to magnet link");
url = Utils::Misc::bcLinkToMagnet(url); 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); BitTorrent::Session::instance()->addTorrent(url);
} }
} }

Loading…
Cancel
Save