How to get .torrent files from magnet link ?
Method 1: using aria2
Read more: How to install aria2 on CentOS
Using this command line:
aria2c -d /path/to/save/torrent/file --bt-metadata-only=true --bt-save-metadata=true "magnet link"
E.g:
aria2c -d /home/torrents --bt-metadata-only=true --bt-save-metadata=true "magnet:?xt=urn:btih:D0F4204EA69169F3B640E36A409EF8AAA3E8CAA1&dn=ROH+Wrestling+28th+Sept+2018+WEBRip+h264-TJ+%5BTJET%5D&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2F9.rarbg.me%3A2710%2Fannounce&tr=udp%3A%2F%2F9.rarbg.com%3A2710%2Fannounce&tr=udp%3A%2F%2Fshadowshq.yi.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.pirateparty.gr%3A6969%2Fannounce&tr=udp%3A%2F%2Fipv4.tracker.harry.lu%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.eddie4.nl%3A6969%2Fannounce&tr=udp%3A%2F%2Fshadowshq.eddie4.nl%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2F9.rarbg.me%3A2780%2Fannounce&tr=udp%3A%2F%2F9.rarbg.to%3A2710%2Fannounce&tr=udp%3A%2F%2Fp4p.arenabg.ch%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.zer0day.to%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fcoppersurfer.tk%3A6969%2Fannounce"
Method 2: Nodejs
Using parse-torrent
E.g:
const parseTorrent = require('parse-torrent'); const fs = require('fs'); const info = parseTorrent('magnet link'); const buf = parseTorrent.toTorrentFile(info); fs.writeFile('ex.torrent', buf, (err) => { if (err) throw err; console.log('The torrent file has been saved!'); });