Example usage:
node hash.js 'magnet:magnet-uri'
Outputs:
Movie hash: f2213716da24f71b
File size: 274429
File name: My-Movie.mp4
Example usage:
node hash.js 'magnet:magnet-uri'
Outputs:
Movie hash: f2213716da24f71b
File size: 274429
File name: My-Movie.mp4
| var torrentUrl = process.argv[2]; | |
| var torrentStream = require('torrent-stream'); | |
| var torrentHash = require('os-torrent-hash'); | |
| var engine = torrentStream(torrentUrl); | |
| torrentHash.computeHash(torrentUrl, engine) // engine is a torrent-stream engine | |
| .then(function (res) { | |
| console.log("Movie hash: " + res.movieHash); | |
| console.log("File size: " + res.fileSize); | |
| console.log("File name: " + res.fileName); | |
| process.exit(code=0) | |
| }) | |
| .catch(function (error) { | |
| process.exit(code=1) | |
| }) | |
| .done(); |
| sudo npm install torrent-stream os-torrent-hash |
| Torrent Hash |