Is there a way to do it? I already tried with monotorrent, but due to the lack of up-to-date documentation i coudn't get it to work. I've already tried this with monotorrent, but still i can't find a way to get the .torrent file or even start the download to get the .torrent ...
The following piece of code was made that question as base, but it doesn't save anything to "D:\A" or to "D:\TorrentSave"
private void GerarTorrent(string magnet)
{
MonoTorrent.Client.TorrentManager b = new MonoTorrent.Client.TorrentManager(new MonoTorrent.MagnetLink(magnet), "D:\\A", new MonoTorrent.Client.TorrentSettings(), "D:\\TorrentSave");
MonoTorrent.Client.EngineSettings engineSettings = new MonoTorrent.Client.EngineSettings();
MonoTorrent.Client.ClientEngine clientEngine = new MonoTorrent.Client.ClientEngine(engineSettings);
clientEngine.Register(b);
clientEngine.StartAll();
b.Start();
}
To generate the .torrent, it doesn't have to be monotorrent, in fact the only usage of this api would be for that, generating .torrent files from a magnet link...
EDIT: Updated code with my attempt on doing what Fᴀʀʜᴀɴ Aɴᴀᴍ said:
private void GerarTorrent(string hash)
{
MonoTorrent.Client.TorrentManager b = new MonoTorrent.Client.TorrentManager(MonoTorrent.InfoHash.FromHex(hash), "D:\\A", new MonoTorrent.Client.TorrentSettings(), "D:\\TorrentSave", new List<List<string>>());
MonoTorrent.Client.EngineSettings engineSettings = new MonoTorrent.Client.EngineSettings();
MonoTorrent.Client.ClientEngine clientEngine = new MonoTorrent.Client.ClientEngine(engineSettings);
clientEngine.Register(b);
clientEngine.StartAll();
b.Start();
}
Hash used = "5FC86BA08451CF4221E0091F31AF1A52C2219009"
You need to pass only the hash and not the entire magnet link to the
TorrentManagerconstructor.A magnet link looks like this:
So, a more generalized form:
You need to extract this
<hash>and pass it to the constructor: