Sorry if my English is approximate, I am using a translator. I recently tried to create a program to automatically create a Discord account using their API. For solving the captcha, I am using the Anticaptcha API, but every time my code gives me the error “sitekey-secret-mismatch” even though on my Anticaptcha dashboard the captcha has been solved successfully. I am almost sure that the sitekey is correct.
Here is my code:
from anticaptchaofficial.hcaptchaproxyless import hCaptchaProxyless
headers = {
'Content-Type': 'application/json',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
}
url_register = "https://discord.com/api/v9/auth/register"
user_data = {
"email": "[email protected]",
"username": "qsdkfjkjhskddf",
"password": "@1cling-uncurled-gem",
"date_of_birth": "2000-01-01",
"consent": True,
"gift_code_sku_id": None,
"captcha_key": None
}
def solve_hcaptcha(sitekey, url):
solver = hCaptchaProxyless()
solver.set_verbose(1)
solver.set_key('my_anticaptcha_api_key')
solver.set_website_url(url)
solver.set_website_key(sitekey)
captcha_solution = solver.solve_and_return_solution()
if captcha_solution != 0:
return captcha_solution
else:
print("Impossible de résoudre le CAPTCHA")
return None
captcha_sitekey = '4c672d35-0701-42b2-88c3-78380b0db560'
discord_url = "https://discord.com/register"
captcha_solution = solve_hcaptcha(captcha_sitekey, discord_url)
if captcha_solution:
print("CAPTCHA solution:", captcha_solution)
user_data["captcha_key"] = captcha_solution
print("User Data:", user_data)
response = requests.post(url_register, headers=headers, json=user_data)
print("Status Code:", response.status_code)
print("Response JSON:", response.json())
else:
print("Échec de la résolution du CAPTCHA")```
there the fully error:
Status Code: 400
Response JSON: {‘captcha_key’: [‘sitekey-secret-mismatch’], ‘captcha_sitekey’: ‘4c672d35-0701-42b2-88c3-78380b0db560’, ‘captcha_service’: ‘hcaptcha’}
A2V A2V is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.