From .torrent to magnet link
KeizerDev opened this issue · 3 comments
KeizerDev commented
How can I get from this:
parseTorrent.remote(torrentId, function (err, parsedTorrent) {
if (err) throw err
console.log(parsedTorrent)
})
To a magnet link?
feross commented
What is torrentId
in this example? Is it a .torrent
file?
feross commented
Once you have a parsedTorrent
, you can use magnet-uri
:
var magnet = require('magnet-uri')
var uri = magnet.encode(parsedTorrent)
console.log(uri) // the magnet uri
KeizerDev commented
Thanks 😃