I hate electron

This commit is contained in:
Elysia 2023-04-24 23:41:13 +07:00
parent 3397d8da71
commit 7f1082c68a

View File

@ -33,12 +33,18 @@ class APIRequest {
make(captchaKey = undefined, captchaRqtoken = undefined) {
// Ciphers
const defaultCiphers = tls.DEFAULT_CIPHERS.split(':');
const temp = _.permutations(defaultCiphers.slice(0, 5), 5).filter(
x => JSON.stringify(x) !== JSON.stringify(defaultCiphers.slice(0, 5)),
);
tls.DEFAULT_CIPHERS = [...temp[Math.floor(Math.random() * temp.length)], ...defaultCiphers.slice(5)].join(':');
crypto.constants.defaultCipherList = tls.DEFAULT_CIPHERS;
try {
const defaultCiphers = tls.DEFAULT_CIPHERS.split(':');
const temp = _.permutations(defaultCiphers.slice(0, 5), 5).filter(
x => JSON.stringify(x) !== JSON.stringify(defaultCiphers.slice(0, 5)),
);
tls.DEFAULT_CIPHERS = [...temp[Math.floor(Math.random() * temp.length)], ...defaultCiphers.slice(5)].join(':');
crypto.constants.defaultCipherList = tls.DEFAULT_CIPHERS;
// eslint-disable-next-line no-unused-vars
} catch (_) {
// Ignore
// I hate Electron Node.js
}
if (agent === null) {
if (typeof this.client.options.proxy === 'string' && this.client.options.proxy.length > 0) {