MonoTorrent - Magnet link to Torrent file

前端 未结 2 883
梦如初夏
梦如初夏 2021-01-13 22:00

Is there a way to generate .torrent file from a magnet link using the MonoTorrent .Net library? If so can someone explain with an example? I searched the site as well as goo

2条回答
  •  情深已故
    2021-01-13 22:18

    yes, It could be done using the monotorrent library.

    you could take the hash value from the magnet link and use it to create a torrent manager that will create a torrent file before downloading.

    if this were the magnet link:

    magnet:?xt=urn:btih:18981bc9759950b4715ad46adcaf514e6a773cfe

    hash=18981bc9759950b4715ad46adcaf514e6a773cfe;
    manager = new TorrentManager(InfoHash.FromHex(hash), downloadsPath, torrentDefaults,     downloadsPathForTorrent);
    

    this should download a torrent file to 'downloadsPathForTorrent', and you can stop the download as soon as it begins.

    hope this helped.

    for more information on how to implement this checkout the monotorrent documentation:

    http://www.mono-project.com/MonoTorrent

提交回复
热议问题