Grosse refonte + Ajout /amp + Correctif /crack
This commit is contained in:
18
utilsCrack/download.js
Normal file
18
utilsCrack/download.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const axios = require('axios')
|
||||
const fs = require('fs')
|
||||
|
||||
module.exports = download = (async (url, file, headers) => {
|
||||
let path = `./cracks/${file}`
|
||||
let writer = fs.createWriteStream(path)
|
||||
try {
|
||||
await axios({ url: url + file, method: 'GET', responseType: 'stream', headers }).then(response => {
|
||||
return new Promise((resolve, reject) => {
|
||||
response.data.pipe(writer)
|
||||
let error = null
|
||||
writer.on('error', err => { error = err; writer.close(); reject(err) })
|
||||
writer.on('close', () => { if (!error) resolve(true) })
|
||||
})
|
||||
}).catch(console.error)
|
||||
return path
|
||||
} catch (error) { console.error(error) }
|
||||
})
|
||||
13
utilsCrack/repo.js
Normal file
13
utilsCrack/repo.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const iconv = require('iconv-lite')
|
||||
|
||||
module.exports = repo = (async (game, headers) => {
|
||||
let body = await fetch(game.link, { headers, body: null, method: "GET" })
|
||||
.then(response => response.arrayBuffer())
|
||||
.then(arrayBuffer => { return iconv.decode(Buffer.from(arrayBuffer), 'win1251') })
|
||||
.catch(console.error)
|
||||
try {
|
||||
let name = body.split('https://uploads.online-fix.me:2053/torrents/')[1].split('"')[0]
|
||||
let url = `https://uploads.online-fix.me:2053/torrents/${name}`
|
||||
return url
|
||||
} catch (error) { console.error(error) }
|
||||
})
|
||||
19
utilsCrack/search.js
Normal file
19
utilsCrack/search.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const iconv = require('iconv-lite')
|
||||
|
||||
module.exports = search = (async (query, headers) => {
|
||||
let body = await fetch("https://online-fix.me/engine/ajax/search.php", { headers, body: `query=${query}`, method: "POST" })
|
||||
.then(response => response.arrayBuffer())
|
||||
.then(arrayBuffer => { return iconv.decode(Buffer.from(arrayBuffer), 'win1251') })
|
||||
.catch(console.error)
|
||||
try {
|
||||
let matches = body.split('</div>')[1].split('<span class="seperator fastfullsearch">')[0].split('</a>')
|
||||
let games = []
|
||||
matches.pop()
|
||||
matches.forEach(async match => {
|
||||
let name = match.split('"><span class="searchheading">')[1].split('</span>')[0].slice(0, -8)
|
||||
let link = match.split('<a href="')[1].split('"><span class="searchheading">')[0]
|
||||
games.push({ name, link })
|
||||
})
|
||||
return games
|
||||
} catch (error) { console.error(error) }
|
||||
})
|
||||
8
utilsCrack/torrent.js
Normal file
8
utilsCrack/torrent.js
Normal file
@@ -0,0 +1,8 @@
|
||||
module.exports = torrent = (async (url, headers) => {
|
||||
let response = await fetch(url, { headers, body: null, method: "GET" }).catch(console.error)
|
||||
try {
|
||||
let body = await response.text()
|
||||
let file = body.split('<a href="')[2].split('">')[0]
|
||||
return file
|
||||
} catch (error) { console.error(error) }
|
||||
})
|
||||
Reference in New Issue
Block a user