TikTokDownload
TikTokDownload copied to clipboard
x-bogus.js, file (optimized version)
see here,
let b = require("md5");
let c = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 10, 11, 12, 13, 14, 15];
let d = "Dkdpgh4ZKsQB80/Mfvw36XI1R25-WUAlEi7NLboqYTOPuzmFjJnryx9HVGcaStCe=";
function f(a) {
let b = [];
for (let d = 0; d < a.length;) {
b.push(c[a.charCodeAt(d++)] << 4 | c[a.charCodeAt(d++)]);
}
return b;
}
function g(a) {
return f(b(f(b(a))));
}
function h(a) {
return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a);
}
function i(a) {
var b;
var c;
var d;
var f;
var g;
var i = "";
for (b = 0; b < a.length - 3; b += 4) {
c = h(a.charAt(b));
d = h(a.charAt(b + 1));
f = h(a.charAt(b + 2));
g = h(a.charAt(b + 3));
i += String.fromCharCode(c << 2 | d >>> 4);
if (a.charAt(b + 2) !== "=") {
i += String.fromCharCode(d << 4 & 240 | f >>> 2 & 15);
}
if (a.charAt(b + 3) !== "=") {
i += String.fromCharCode(f << 6 & 192 | g);
}
}
return i;
}
function j() {
var a = "";
try {
if (window.sessionStorage) {
a = window.sessionStorage.getItem("_byted_param_sw");
}
if (!a || !!window.localStorage) {
a = window.localStorage.getItem("_byted_param_sw");
}
} catch (a) {}
if (a) {
try {
var b = _0x3459bb(i(a.slice(8)), a.slice(0, 8));
if (b === "on") {
return true;
}
if (b === "off") {
return false;
}
} catch (a) {}
}
return false;
}
function k(a) {
try {
if (window.localStorage) {
return window.localStorage.getItem(a);
} else {
return null;
}
} catch (a) {
return null;
}
}
function m(a, b, c) {
let f = (a & 255) << 16;
let e = (b & 255) << 8;
let g = f | e | c;
return d[(g & 16515072) >> 18] + d[(g & 258048) >> 12] + d[(g & 4032) >> 6] + d[g & 63];
}
function n(a) {
if (a !== undefined && a != "") {
_0x402a35.ttwid = a;
}
}
function o() {
var a = k("xmst");
return a || "";
}
function p(b, j, k, l, e, m, n, o, d, a, c, i, f, q, r, h, g, t, s) {
let p = new Uint8Array(19);
p[0] = b;
p[1] = c;
p[2] = j;
p[3] = i;
p[4] = k;
p[5] = f;
p[6] = l;
p[7] = q;
p[8] = e;
p[9] = r;
p[10] = m;
p[11] = h;
p[12] = n;
p[13] = g;
p[14] = o;
p[15] = t;
p[16] = d;
p[17] = s;
p[18] = a;
return String.fromCharCode.apply(null, p);
}
function q(b, c) {
let f;
let g = [];
let e = 0;
let h = "";
let i = 0;
let j = 0;
let k = 0;
for (let a = 0; a < 256; a++) {
g[a] = a;
}
for (; i < 256; i++) {
e = (e + g[i] + b.charCodeAt(i % b.length)) % 256;
f = g[i];
g[i] = g[e];
g[e] = f;
}
e = 0;
for (; j < c.length; j++) {
e = (e + g[k = (k + 1) % 256]) % 256;
f = g[k];
g[k] = g[e];
g[e] = f;
h += String.fromCharCode(c.charCodeAt(j) ^ g[(g[k] + g[e]) % 256]);
}
return h;
}
function s(a, b, c) {
return String.fromCharCode(a) + String.fromCharCode(b) + c;
}
function t(h) {
// douyin
let j = f(b("d4+pTKoNjJFb5tMtAC3XB9XrDDxlig1kjbh32u+x5YcwWb/me2pvLTh6ZdBVN5skEeIaOYNixbnFK6wyJdl/Lcy9CDAcpXLLQc3QFKIDQ3KkQYie3n258eLS1YFUqFLDjn7dqCRp1jjoORamU2SV"));
// douyin & tiktok
let k = f(b(f("d41d8cd98f00b204e9800998ecf8427e")));
let l = g(h);
let e = new Date().getTime() / 1000;
let n = 536919696;
let r = [];
let o = [];
let d = "";
let t = [64, 0.00390625, 1, 8, l[14], l[15], k[14], k[15], j[14], j[15], e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e >> 0 & 255, n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n >> 0 & 255];
t.push(t.reduce(function (a, b) {
return a ^ b;
}));
for (let a = 0; a < t.length; a += 2) {
r.push(t[a]);
o.push(t[a + 1]);
}
//unescape('%FF')
let c = s.apply(null, [2, 255, q.apply(null, [String.fromCharCode(255), p.apply(null, r.concat(o).slice(0, 19))])]);
for (let a = 0; a < c.length;) {
d += m(c.charCodeAt(a++), c.charCodeAt(a++), c.charCodeAt(a++));
}
return d;
}
_0x180b4c = o();
module.exports = {
getXB: t
};