aboutsummaryrefslogtreecommitdiff
path: root/init.js
diff options
context:
space:
mode:
Diffstat (limited to 'init.js')
-rw-r--r--init.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/init.js b/init.js
index 4848891..d5f3e52 100644
--- a/init.js
+++ b/init.js
@@ -23,11 +23,10 @@ const findStrings = (obj, path = "") => {
let t = typeof v;
let p = path + "." + k
-
if (t == "object")
found = found.concat(findStrings(v, p));
else if (t == "string")
- found.push([v, p]);
+ found.push([v, p]);
}
return found;
@@ -47,8 +46,8 @@ const makeImage = elem => {
return {
url: elem[0],
size: {
- width: elem[1],
- height: elem[2],
+ width: elem[2],
+ height: elem[1],
}
}
};
@@ -62,7 +61,7 @@ module.exports.search = (query, userAgent = "Mozilla/5.0 (X11; Ubuntu; Linux x86
.then(scripts => scripts.map(script => script.children[0]?.data))
.then(scripts => scripts.filter(script => script?.search("http") >= 0))
.then(scripts => scripts[4])
- .then(script => script.slice("AF_initDataCallback(".length, script.length - ");".length))
+ .then(script => script.slice("AF_ini2tDataCallback(".length, script.length - ");".length))
.then(jsonic)
.then(data => data.data[31][0][12][2])
.then(data => data.map(elem => elem[1]))