I'm wanting to include some bittorrent features in my Scala app. I want to use magnet links exclusively if I can for their ease of use. The issue is I'd like to use a prebuilt library like ttorrent. But, I found these libs don't use magnet links, they use the metainfo or the torrent file itself.
So I figure my first step is to take the magnet link and build a metainfo object myself. I understand the makeup of the magnet link pretty well and can parse it into the parameters. I'm just not quite sure how to use the magnet parameters. I don't know what to do with them.
Here's just a test magnet link I found on PB to work with:
magnet:?xt=urn:btih:ad11eb1a0aeed57116225fb341dc61883c22aeba&dn=Rise.of.the.Guardians.2012.TS.NEW.SOURCE.x264.AAC-UNiQUE&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80
After parsing it I get:
xt=urn:btih:ad11eb1a0aeed57116225fb341dc61883c22aeba
dn=Rise.of.the.Guardians.2012.TS.NEW.SOURCE.x264.AAC-UNiQUE
tr=udp://tracker.openbittorrent.com:80
tr=udp://tracker.publicbt.com:80
tr=udp://tracker.istole.it:6969
tr=udp://tracker.ccc.de:80
Simple enough. Now I haven't used hashes too much, but I'm pretty sure I can't get any info from it directly. My only guess is that I may have to contact one of the trackers to get the metainfo. I'm not sure though.
[fyi] The torrenting will only be used for legal sharing, to share app data and app files between users of the app.