Ajout lien magnet et embed pour /crack

This commit is contained in:
Zachary Guénot
2023-06-15 20:03:46 +02:00
parent 432198c4f7
commit 30bb35c4e7
5 changed files with 351 additions and 125 deletions

12
utilsCrack/magnet.js Normal file
View File

@@ -0,0 +1,12 @@
const fs = require('fs')
module.exports = magnet = (async path => {
const parseTorrent = await import('parse-torrent')
const parse = parseTorrent.default
const magnetURI = parseTorrent.toMagnetURI
let data = await parse(fs.readFileSync(path))
let uri = await magnetURI({ infoHash: data.infoHash })
return uri
})