Есть два скрипта, один на JS, второй на Python.
Скрипт приглашает аккаунты на сервер в Discord по токену и инвайт-коду ( код приглашения )
Скрипт на JS - написан на библиотеке Node-fetch
Скрипт на Py - написан на библиотеке Requests
Скрипты написаны одинаково, хедеры и функции одинаковые, но если скрипт на Python отрабатывает и с аккаунтом все хорошо после выхода с сервера, то скрипт на JS отрабатывает так же, но после выхода с сервера аккаунт улетает в бан у дискорда через 10-15 секунд после выхода. Я уже перепробовал и обрыл все что мог, пожалуйста помогите. Возможно я чего-то не понимаю в запросах на JS, вот код:
Только пожалуйста, не подставляйте токен от своего аккаунта, так как высока вероятность, что ваш аккаунт может отлететь.
JS
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
const token = ""
const invite_code = ""
async function inviter(token, invite_code) {
let headers = {
"x-super-properties": "eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRmlyZWZveCIsImRldmljZSI6IiIsInN5c3RlbV9sb2NhbGUiOiJlbi1VUyIsImJyb3dzZXJfdXNlcl9hZ2VudCI6Ik1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjA7IFdpbjY0OyB4NjQ7IHJ2OjkzLjApIEdlY2tvLzIwMTAwMTAxIEZpcmVmb3gvOTMuMCIsImJyb3dzZXJfdmVyc2lvbiI6IjkzLjAiLCJvc192ZXJzaW9uIjoiMTAiLCJyZWZlcnJlciI6IiIsInJlZmVycmluZ19kb21haW4iOiIiLCJyZWZlcnJlcl9jdXJyZW50IjoiIiwicmVmZXJyaW5nX2RvbWFpbl9jdXJyZW50IjoiIiwicmVsZWFzZV9jaGFubmVsIjoic3RhYmxlIiwiY2xpZW50X2J1aWxkX251bWJlciI6MTAwODA0LCJjbGllbnRfZXZlbnRfc291cmNlIjpudWxsfQ==",
"sec-fetch-dest": "empty",
"x-debug-options": "bugReporterEnabled",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"accept": "*/*",
"accept-language": "en-GB",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) discord/0.0.16 Chrome/91.0.4472.164 Electron/13.4.0 Safari/537.36",
"TE": "trailers"
}
headers["authorization"] = token
headers["x-fingerprint"] = await getFingerprint()
headers["cookie"] = await getCookies()
let response = await fetch(`https://discord.com/api/v9/invites/${invite_code}`, {
method: 'POST',
body: JSON.stringify({}),
headers: headers
})
console.log(response.status)
};
async function getFingerprint() {
let headers = {
"accept": "*/*",
"authority": "discord.com",
"method": "POST",
"path": "/api/v9/auth/register",
"scheme": "https",
"origin": "discord.com",
"referer": "discord.com/register",
"x-debug-options": "bugReporterEnabled",
"accept-language": "en-US,en;q=0.9",
"connection": "keep-alive",
"content-Type": "application/json",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9003 Chrome/91.0.4472.164 Electron/13.4.0 Safari/537.36",
"x-super-properties": "eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRGlzY29yZCBDbGllbnQiLCJyZWxlYXNlX2NoYW5uZWwiOiJzdGFibGUiLCJjbGllbnRfdmVyc2lvbiI6IjEuMC45MDAzIiwib3NfdmVyc2lvbiI6IjEwLjAuMjIwMDAiLCJvc19hcmNoIjoieDY0Iiwic3lzdGVtX2xvY2FsZSI6ImVuLVVTIiwiY2xpZW50X2J1aWxkX251bWJlciI6MTA0OTY3LCJjbGllbnRfZXZlbnRfc291cmNlIjpudWxsfQ==",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
}
let response = await fetch('https://discordapp.com/api/v9/experiments', {
method: 'GET',
headers: headers
})
response = await response.json()
response = response['fingerprint']
return response
};
async function getCookies() {
let response = await fetch('https://discord.com', {
method: 'get'
})
response = response.headers.get('set-cookie')
return response
};
(async () => {
await inviter(token, invite_code)
})()
Py
import json
import base64
from anticaptchaofficial.hcaptchaproxyless import *
from capmonster_python import HCaptchaTask
import requests
token = 'OTc2NjM3MDQ2MTI0ODQzMTE5.GnFM8p.K-iwor04tCGRh_lYr6JtUBE5cFUeDyiT0MQe8c'
invite_code = 'W5kNpGUb'
headers_for_connect_to_guild = {
"x-super-properties": "eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRmlyZWZveCIsImRldmljZSI6IiIsInN5c3RlbV9sb2NhbGUiOiJlbi1VUyIsImJyb3dzZXJfdXNlcl9hZ2VudCI6Ik1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjA7IFdpbjY0OyB4NjQ7IHJ2OjkzLjApIEdlY2tvLzIwMTAwMTAxIEZpcmVmb3gvOTMuMCIsImJyb3dzZXJfdmVyc2lvbiI6IjkzLjAiLCJvc192ZXJzaW9uIjoiMTAiLCJyZWZlcnJlciI6IiIsInJlZmVycmluZ19kb21haW4iOiIiLCJyZWZlcnJlcl9jdXJyZW50IjoiIiwicmVmZXJyaW5nX2RvbWFpbl9jdXJyZW50IjoiIiwicmVsZWFzZV9jaGFubmVsIjoic3RhYmxlIiwiY2xpZW50X2J1aWxkX251bWJlciI6MTAwODA0LCJjbGllbnRfZXZlbnRfc291cmNlIjpudWxsfQ==",
"sec-fetch-dest": "empty",
"x-debug-options": "bugReporterEnabled",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"accept": "*/*",
"accept-language": "en-GB",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) discord/0.0.16 Chrome/91.0.4472.164 Electron/13.4.0 Safari/537.36",
"TE": "trailers"
}
headers_for_get_fingerprint = {
"accept": "*/*",
"authority": "discord.com",
"method": "POST",
"path": "/api/v9/auth/register",
"scheme": "https",
"origin": "discord.com",
"referer": "discord.com/register",
"x-debug-options": "bugReporterEnabled",
"accept-language": "en-US,en;q=0.9",
"connection": "keep-alive",
"content-Type": "application/json",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9003 Chrome/91.0.4472.164 Electron/13.4.0 Safari/537.36",
"x-super-properties": "eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRGlzY29yZCBDbGllbnQiLCJyZWxlYXNlX2NoYW5uZWwiOiJzdGFibGUiLCJjbGllbnRfdmVyc2lvbiI6IjEuMC45MDAzIiwib3NfdmVyc2lvbiI6IjEwLjAuMjIwMDAiLCJvc19hcmNoIjoieDY0Iiwic3lzdGVtX2xvY2FsZSI6ImVuLVVTIiwiY2xpZW50X2J1aWxkX251bWJlciI6MTA0OTY3LCJjbGllbnRfZXZlbnRfc291cmNlIjpudWxsfQ==",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
}
def getFingerPrint():
response = requests.get("https://discordapp.com/api/v9/experiments", headers=headers_for_get_fingerprint, timeout=60).json()
response = response['fingerprint']
return response
def getCookies():
response = requests.get("https://discord.com", headers={"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36"})
cookies = response.cookies.get_dict()
return cookies
def captcha_bypass(url, key):
solver = hCaptchaProxyless()
solver.set_key("fd23eb308894297bb8ee757061a571b5")
solver.set_website_url(url)
solver.set_website_key(key)
g_response = solver.solve_and_return_solution()
if g_response != 0:
return g_response
def main(token, invite_code):
headers_for_connect_to_guild["authorization"] = token
headers_for_connect_to_guild["x-fingerprint"] = getFingerPrint()
response = requests.post(f"https://discord.com/api/v9/invites/{invite_code}", headers=headers_for_connect_to_guild, cookies=getCookies(), timeout=20)
if response.status_code == 400:
response_captcha = requests.post(f"https://discord.com/api/v9/invites/{invite_code}", json={"captcha_key": captcha_bypass("https://discord.com", f"{response.json()['captcha_sitekey']}")}, headers=headers_for_connect_to_guild, cookies=getCookies(), timeout=20)
print(response_captcha.status_code)
print(response_captcha.json())
main(token=token, invite_code=invite_code)