diff --git a/src/download_helper.cc b/src/download_helper.cc index 93d19ee2..2879b8c3 100644 --- a/src/download_helper.cc +++ b/src/download_helper.cc @@ -70,6 +70,7 @@ // TODO ENABLE CONTROLFILE #include "TorrentAttribute.h" #include "bittorrent_helper.h" +#include "DefaultBtProgressInfoFile.h" namespace aria2 { @@ -453,9 +454,10 @@ public: else if (!ignoreLocalPath_ && detector_.guessAria2ControlFile(uri)) { // Extract hash and construct a magnet to feed into createBtMagentRequestGroup + const auto infoHash = DefaultBtProgressInfoFile::getInfoHash(uri); - auto torrent_attribute = std::make_unique(); - // torrent_attribute->infoHash = the hash from the file + auto torrent_attribute = std::make_unique(); + torrent_attribute->infoHash = std::string(std::begin(infoHash), std::end(infoHash)); const auto magent = aria2::bittorrent::torrent2Magnet(torrent_attribute.get()); requestGroups_.push_back(createBtMagnetRequestGroup(magent, option_));