Grosse refonte + Ajout /amp + Correctif /crack
This commit is contained in:
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) }
|
||||
})
|
||||
Reference in New Issue
Block a user