Ошибка в тексте:ERROR_CAPTCHA_UNSOLVABLE
Код:
import requests
from python_rucaptcha.HCaptcha import HCaptcha
from nickname_generator import generate
RUCAPTCHA_KEY = 'тут ключ'
nik = generate()
with open("email.txt", "r", encoding="utf8") as f:
fli = f.readlines()
for em in fli:
em = em.split(":")
login = em[0]
password = em[1]
headers = {
'authority': 'discord.com',
'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"',
'x-super-properties': 'eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiQ2hyb21lIiwiZGV2aWNlIjoiIiwic3lzdGVtX2xvY2FsZSI6InJ1LVJVIiwiYnJvd3Nlcl91c2VyX2FnZW50IjoiTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk4LjAuNDc1OC44MiBTYWZhcmkvNTM3LjM2IiwiYnJvd3Nlcl92ZXJzaW9uIjoiOTguMC40NzU4LjgyIiwib3NfdmVyc2lvbiI6IjEwIiwicmVmZXJyZXIiOiIiLCJyZWZlcnJpbmdfZG9tYWluIjoiIiwicmVmZXJyZXJfY3VycmVudCI6IiIsInJlZmVycmluZ19kb21haW5fY3VycmVudCI6IiIsInJlbGVhc2VfY2hhbm5lbCI6InN0YWJsZSIsImNsaWVudF9idWlsZF9udW1iZXIiOjExNDc2NCwiY2xpZW50X2V2ZW50X3NvdXJjZSI6bnVsbH0=',
'x-fingerprint': '943038824022409308.GpZKT3JnEZyU5GfaC3_Nr23VZ_E',
'x-debug-options': 'bugReporterEnabled',
'sec-ch-ua-mobile': '?0',
'authorization': 'undefined',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36',
'x-discord-locale': 'ru',
'sec-ch-ua-platform': '"Windows"',
'accept': '*/*',
'origin': 'https://discord.com',
'sec-fetch-site': 'same-origin',
'sec-fetch-mode': 'cors',
'sec-fetch-dest': 'empty',
'referer': 'https://discord.com/register',
'accept-language': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
}
json_data = {
'fingerprint': '943038824022409308.GpZKT3JnEZyU5GfaC3_Nr23VZ_E',
'email': login,
'username': nik,
'password': password,
'invite': None,
'consent': True,
'date_of_birth': '1995-05-04',
'gift_code_sku_id': None,
'captcha_key': None,
}
response = requests.post('https://discord.com/api/v9/auth/register', headers=headers, json=json_data)
key = response.json()
print(key)
website_link = "https://discord.com/api/v9/auth/register"
data_sitekey = "4c672d35-0701-42b2-88c3-78380b0db56"
answer = HCaptcha(rucaptcha_key=RUCAPTCHA_KEY).captcha_handler(
site_key=data_sitekey, page_url=website_link
)
if not answer['error']:
# решение капчи
print(answer['captchaSolve'])
print(answer['taskId'])
elif answer['error']:
# Тело ошибки, если есть
print(answer ['errorBody'])
fe = open('result.txt','a')
fe.write(str (nik) + ":" + password + ":" + login + "\n")
fe.close()