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