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