1

I am going crazy right now. Since all other questions are several years old and the MonoTorrent developers have gone MIA I really need your help.

What I am really stuck with is parsing the magnet link and downloading it.

This is my code:

    public static void DownloadTorrent(string magnetLink)
    {
        MagnetLink link = new MagnetLink(magnetLink);

        //URL stores the magnetlink
        EngineSettings settings = new EngineSettings();
        settings.AllowedEncryption = EncryptionTypes.All;
        settings.SavePath = destination;

        string torrentFilePath = torrentDestination;

        if (!Directory.Exists(settings.SavePath))
            Directory.CreateDirectory(settings.SavePath);

        if (!Directory.Exists(torrentFilePath))
            Directory.CreateDirectory(torrentFilePath);

        //Create a new engine, give it some settings and use it.
        ClientEngine engine = new ClientEngine(settings);
        engine.ChangeListenEndpoint(new IPEndPoint(IPAddress.Any, 6969));

        TorrentManager manager = new TorrentManager(link, engine.Settings.SavePath, new TorrentSettings(), torrentFilePath);
        engine.Register(manager);
        manager.Start();

        Console.ReadLine();

    }

And my magnet link is: "magnet:?xt=urn:btih:c6df2f47d033d54b054cafe7ef683ba167222d92&dn=Windows+XP+Professional+SP3+-+Activated&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969"

Now an error throws on the magnet link saying "No such host is known and referring to udp://exodus.desync.com:6969/"(Visual Studio is on swedish so that might not be a literal translation).

Visual Studio is marking tracker = new UdpClient(announceUrl.Host, announceUrl.Port); as the error source and it's located inside one of MonoTorrent's code files; UdpTracker.cs

I am trying to make a simple application and I am just stuck on this part.

Any help is greatly appreciated. It's one of my first times posting here so if I missed to mention anything just tell me and I will add it.

Thanks on forehand! Also pardon my english, I am not a native speaker.

Update: If you know another way of solving this even without MonoTorrnet - I will take any help I can.

Albin Alm
  • 11
  • 3
  • 1
    According to your translation, the host not being known is not a problem with your code. It simply means, your program/computer cannot resolve the host name exodus.desync.com (i.e., translate it into an IP address). In other words: the DNS server you are using for your network connection does not have an entry for "exodus.desync.com". (I did a quick check using Google's DNS, and nope, exodus.desync.com is not there either...) –  Apr 28 '17 at 21:31
  • Hm, I see, though there must be a workaround for that since softwares like uTorrent manage to parse the link, any idea how I would solve this? – Albin Alm Apr 29 '17 at 12:59
  • Unfortunately i do not know much about the torrent protocol and the uTorrent client and have absolutely no clue about how uTorrent can find a torrent when the original tracker is down. Sorry... :( –  Apr 29 '17 at 16:47
  • Okay, damn it's so frustrating how it feels impossible while I know it arent. – Albin Alm Apr 30 '17 at 12:14

0 Answers0