Ajout lien magnet et embed pour /crack
This commit is contained in:
12
utilsCrack/magnet.js
Normal file
12
utilsCrack/magnet.js
Normal 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
|
||||
})
|
||||
Reference in New Issue
Block a user