mirror of https://github.com/aria2/aria2
[ControlFile] Make magent request from control file
parent
a5da420c01
commit
07676f7f9c
|
@ -70,6 +70,7 @@
|
||||||
// TODO ENABLE CONTROLFILE
|
// TODO ENABLE CONTROLFILE
|
||||||
#include "TorrentAttribute.h"
|
#include "TorrentAttribute.h"
|
||||||
#include "bittorrent_helper.h"
|
#include "bittorrent_helper.h"
|
||||||
|
#include "DefaultBtProgressInfoFile.h"
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
@ -453,9 +454,10 @@ public:
|
||||||
else if (!ignoreLocalPath_ && detector_.guessAria2ControlFile(uri))
|
else if (!ignoreLocalPath_ && detector_.guessAria2ControlFile(uri))
|
||||||
{
|
{
|
||||||
// Extract hash and construct a magnet to feed into createBtMagentRequestGroup
|
// Extract hash and construct a magnet to feed into createBtMagentRequestGroup
|
||||||
|
const auto infoHash = DefaultBtProgressInfoFile::getInfoHash(uri);
|
||||||
|
|
||||||
auto torrent_attribute = std::make_unique<const TorrentAttribute>();
|
auto torrent_attribute = std::make_unique<TorrentAttribute>();
|
||||||
// torrent_attribute->infoHash = the hash from the file
|
torrent_attribute->infoHash = std::string(std::begin(infoHash), std::end(infoHash));
|
||||||
const auto magent = aria2::bittorrent::torrent2Magnet(torrent_attribute.get());
|
const auto magent = aria2::bittorrent::torrent2Magnet(torrent_attribute.get());
|
||||||
|
|
||||||
requestGroups_.push_back(createBtMagnetRequestGroup(magent, option_));
|
requestGroups_.push_back(createBtMagnetRequestGroup(magent, option_));
|
||||||
|
|
Loading…
Reference in New Issue