Added new method to verify

This commit is contained in:
Ivan Nikolskiy 2025-07-10 13:19:42 +02:00
parent adddfb2737
commit ee1208671e
2 changed files with 0 additions and 3 deletions

View File

@ -135,7 +135,6 @@ def hoptcha_protected(
pass # Malformed or empty JSON pass # Malformed or empty JSON
if not token or not verify_token(token): if not token or not verify_token(token):
print(token)
return response(request) if response else JsonResponse({ return response(request) if response else JsonResponse({
"captcha": True, "captcha": True,
"url": f"{HOPTCHA_URL}?{urlencode({'client_key': HOPTCHA_CLIENT_ID, 'timestamp': int(time.time() * 1000), 'type': type})}" "url": f"{HOPTCHA_URL}?{urlencode({'client_key': HOPTCHA_CLIENT_ID, 'timestamp': int(time.time() * 1000), 'type': type})}"

View File

@ -42,8 +42,6 @@ def verify_token(token):
headers = {"Content-Type": "application/json"} headers = {"Content-Type": "application/json"}
response = requests.post(HOPTCHA_VERIFY_URL, data=json.dumps(payload), headers=headers, timeout=5) response = requests.post(HOPTCHA_VERIFY_URL, data=json.dumps(payload), headers=headers, timeout=5)
print(HOPTCHA_VERIFY_URL, HOPTCHA_CLIENT_SECRET)
if response.status_code == 200: if response.status_code == 200:
return response.json().get("success", False) return response.json().get("success", False)
return False return False