Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@bochilteam/scraper/lib/esm/utils.js
1126 views
1
export class ScraperError extends Error {
2
constructor(message, options) {
3
super(message);
4
this.name = 'ScraperError';
5
this.date = new Date();
6
this.message =
7
message +
8
'\n\nIf this is bug pls report to https://github.com/BochilTeam/scraper';
9
}
10
static createError(message, options) {
11
return new ScraperError(message, options);
12
}
13
}
14
export function decodeSnapApp(...args) {
15
// From reponse snap app
16
function _0xe78c(d, e, f) {
17
const g = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/'.split('');
18
const h = g.slice(0, e);
19
const i = g.slice(0, f);
20
// @ts-ignore
21
// eslint-disable-next-line array-callback-return
22
let j = d.split('').reverse().reduce(function (a, b, c) {
23
// eslint-disable-next-line no-return-assign
24
if (h.indexOf(b) !== -1)
25
return a += h.indexOf(b) * (Math.pow(e, c));
26
}, 0);
27
let k = '';
28
while (j > 0) {
29
k = i[j % f] + k;
30
j = (j - (j % f)) / f;
31
}
32
return k || '0';
33
}
34
function _0xc60e(h, u, n, t, e, r) {
35
r = '';
36
for (let i = 0, len = h.length; i < len; i++) {
37
let s = '';
38
while (h[i] !== n[e]) {
39
s += h[i];
40
i++;
41
}
42
for (let j = 0; j < n.length; j++) {
43
s = s.replace(new RegExp(n[j], 'g'), j.toString());
44
}
45
// @ts-ignore
46
r += String.fromCharCode((_0xe78c(s, e, 10) - t));
47
}
48
return decodeURIComponent(encodeURIComponent(r));
49
}
50
// @ts-ignore
51
return _0xc60e(...args);
52
}
53
//# sourceMappingURL=utils.js.map
54