我坚信MonoTorrent库可以做到这一点,但可能是由于缺乏我无法使其工作的文档.
首先,MonoTorrent似乎能够使用以下代码成功下载原始种子:https: //smuxi.im/wiki/monotorrent/Managing_Torrents
但是由于磁铁链接的普及,我想让磁铁链接工作.将.torrent从它们中取出的"技巧"(比如使用μTorrent生成的那些)对我来说即使使用与上面相同的代码也不起作用.它仍然像这样停滞不前,每秒建立1-3个同行,但没有取得进展:
StackOverflow在这个主题的最佳问题/答案是 MonoTorrent - 磁力链接到Torrent文件,但不幸的是答案甚至没有匹配MonoTorrent构造函数,如下所示:
public TorrentManager(Torrent torrent, string savePath, TorrentSettings settings);
public TorrentManager(MagnetLink magnetLink, string savePath, TorrentSettings settings, string torrentSave);
public TorrentManager(Torrent torrent, string savePath, TorrentSettings settings, string baseDirectory);
public TorrentManager(InfoHash infoHash, string savePath, TorrentSettings settings, string torrentSave, IList<RawTrackerTier> announces);
Run Code Online (Sandbox Code Playgroud)
最后我去尝试了一些其他的代码,显然你需要传递一个MagnetLink或InfoHash,所以我给了它一个InfoHash,如下所示:
ClientEngine engine;
TorrentManager manager;
string savePath;
public TorrentDownload(string savePath)
{
this.engine = new ClientEngine(new EngineSettings());
this.savePath = savePath;
}
public void DownloadMagnet(string hash)
{ …
Run Code Online (Sandbox Code Playgroud)