MonoTorrent - Magnet link to Torrent file

夙愿已清 提交于 2019-12-01 04:52:59

问题


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 googled but cant find a solution. if it is not possible are there any other windows commnd line utility that will get the job done? thanks and appreciate ur help in advance!


回答1:


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




回答2:


I know this is answered few years ago, still I solved it by using a website :

http://torcache.net/torrent/18981BC9759950B4715AD46ADCAF514E6A773CFE.torrent

Just put the hash after the slash.

for exaple will download the same hash as dani gave above.

Work for me, much easier to archive.

Edit:

As @Gabriel Duarte mention, this work only on torrent that uploaded to the site, still I'm using this way because most of the biggest sites upload their torrents to this site, if I even need a better accuracy, I will probably use DHT search engine like this, even though it don't generate .torrent file but it supply .torrent info.

For me start complete Torrent client only for grab torrent file is too much resources I can provide.



来源:https://stackoverflow.com/questions/17329325/monotorrent-magnet-link-to-torrent-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!