Selfbot update
added headers to discord hard to detect selfbot 'x-fingerprint' cookies 'x-super-properties'
This commit is contained in:
@@ -260,6 +260,46 @@ class Client extends BaseClient {
|
||||
.join('.')}`,
|
||||
);
|
||||
|
||||
if (this.options.autoCookie) {
|
||||
/* Auto find fingerprint and add Cookie */
|
||||
let cookie = '';
|
||||
await require('axios')({
|
||||
method: 'get',
|
||||
url: 'https://discord.com/api/v9/experiments',
|
||||
headers: this.options.http.headers,
|
||||
})
|
||||
.then((res) => {
|
||||
if (!'set-cookie' in res.headers) return;
|
||||
res.headers['set-cookie'].map((line) => {
|
||||
line.split('; ').map((arr) => {
|
||||
if (
|
||||
arr.startsWith('Expires') ||
|
||||
arr.startsWith('Path') ||
|
||||
arr.startsWith('Domain') ||
|
||||
arr.startsWith('HttpOnly') ||
|
||||
arr.startsWith('Secure') ||
|
||||
arr.startsWith('Max-Age') ||
|
||||
arr.startsWith('SameSite')
|
||||
) {
|
||||
return;
|
||||
} else {
|
||||
cookie += `${arr}; `;
|
||||
}
|
||||
});
|
||||
});
|
||||
this.options.http.headers['Cookie'] = `${cookie}locale=en`;
|
||||
this.options.http.headers['x-fingerprint'] = res.data.fingerprint;
|
||||
this.emit(Events.DEBUG, `Added Cookie: ${cookie}`);
|
||||
this.emit(Events.DEBUG, `Added Fingerprint: ${res.data.fingerprint}`);
|
||||
})
|
||||
.catch((err) => {
|
||||
this.emit(
|
||||
Events.DEBUG,
|
||||
`Finding Cookie and Fingerprint failed: ${err.message}`,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
if (this.options.presence) {
|
||||
this.options.ws.presence = this.presence._parse(this.options.presence);
|
||||
}
|
||||
|
Reference in New Issue
Block a user