Skip to content

Commit cb80b04

Browse files
committed
Update files
1 parent b161307 commit cb80b04

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

spider/js/独播库.js

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ var rule = {
115115
const len = Math.min(combined.length, ts.length);
116116
for (let i = 0; i < len; i++) interleaved += combined[i] + ts[i];
117117
interleaved += combined.substring(len) + ts.substring(len);
118-
const ssid = this.base64Encode(interleaved).replace(/=/g, '.');
118+
const ssid = base64Encode(interleaved).replace(/=/g, '.');
119119
const rStr = (l) => Array(l).fill(0).map(() => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.charAt(Math.floor(Math.random() * 62))).join('');
120120
return `${this.host}${path}${path.includes('?') ? '&' : '?'}sign=${rStr(60)}&token=${rStr(38)}&ssid=${ssid}`;
121121
},
@@ -128,30 +128,8 @@ var rule = {
128128
for (let i = 0; i < str.length; i += 10) {
129129
res += str.substring(i, i + 10).split('').reverse().join('');
130130
}
131-
try { return this.base64Decode(res.replace(/\./g, '=')); } catch (e) { return ''; }
131+
try { return base64Decode(res.replace(/\./g, '=')); } catch (e) { return ''; }
132132
},
133133

134-
base64Encode: function(t) {
135-
const c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
136-
let o = '', i = 0;
137-
while (i < t.length) {
138-
let n = (t.charCodeAt(i) << 16) | (t.charCodeAt(i + 1) << 8) | t.charCodeAt(i + 2);
139-
o += c.charAt((n >> 18) & 63) + c.charAt((n >> 12) & 63) + c.charAt((n >> 6) & 63) + c.charAt(n & 63);
140-
i += 3;
141-
}
142-
let m = t.length % 3;
143-
return m ? o.slice(0, m - 3) + "===".substring(m) : o;
144-
},
145134

146-
base64Decode: function(s) {
147-
const c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
148-
s = s.replace(/=/g, '');
149-
let o = '', i = 0;
150-
while (i < s.length) {
151-
let n = (c.indexOf(s.charAt(i)) << 18) | (c.indexOf(s.charAt(i + 1)) << 12) | (c.indexOf(s.charAt(i + 2)) << 6) | c.indexOf(s.charAt(i + 3));
152-
o += String.fromCharCode((n >> 16) & 255, (n >> 8) & 255, n & 255);
153-
i += 4;
154-
}
155-
return o.replace(/\0/g, '');
156-
}
157135
};

0 commit comments

Comments
 (0)