Hello friends, I wrote a login code to https://shahid.mbc.net/, but although I solved the captcha, it says that you have not solved the captcha.
return {“responseCode”:401,“faults”:[{“subErrors”:null,“userMessage”:"Sorry, suspicious activity on your account was detected by Google reCAPTCHA. Please try again or contact customer service if the issue persists.“,”internalMessage“:”UNAUTHRIZED invalid captcha token“,”code":20080}]}
please help, I've been dealing with this for days
return {“responseCode”:401,“faults”:[{“subErrors”:null,“userMessage”:"Sorry, suspicious activity on your account was detected by Google reCAPTCHA. Please try again or contact customer service if the issue persists.“,”internalMessage“:”UNAUTHRIZED invalid captcha token“,”code":20080}]}
please help, I've been dealing with this for days
Python:
import requests
import time
s = requests.Session()
site_key = "6Lec1Q0qAAAAAOmMUUj86M8koCFS4FJr0dzxo9qf"
site_url = "https://shahid.mbc.net"
client_key = "CAPSOLVERAPİKEY"
def get_captcha_token():
payload = {
"clientKey": client_key,
"task": {
"type": 'ReCaptchaV3TaskProxyLess',
"websiteKey": site_key,
"websiteURL": site_url,
}
}
res = s.post("https://api.capsolver.com/createTask", json=payload)
resp = res.json()
task_id = resp.get("taskId")
if not task_id:
print("Failed to create task:", res.text)
return None
print(f"Got taskId: {task_id} / Getting result...")
while True:
time.sleep(1)
payload = {"clientKey": client_key, "taskId": task_id}
res = s.post("https://api.capsolver.com/getTaskResult", json=payload)
resp = res.json()
status = resp.get("status")
if status == "ready":
return resp.get("solution", {}).get('gRecaptchaResponse')
if status == "failed" or resp.get("errorId"):
print("Solve failed! Response:", res.text)
return None
token = get_captcha_token()
if token:
print(f"CAPTCHA Token: {token}")
headers = {
'accept': 'application/json',
'accept-language': 'ar',
'content-type': 'application/json',
'language': 'AR',
'origin': 'https://shahid.mbc.net',
'priority': 'u=1, i',
'profile': '{"id":"3bcb3c00-622d-11ef-b483-f3a3b504fa13","master":true}',
'profile-key': '{"isAdult":true}',
'referer': 'https://shahid.mbc.net/',
'sec-ch-ua': '"Not)A;Brand";v="99", "Google Chrome";v="127", "Chromium";v="127"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'cross-site',
'shahid_os': 'WEB',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36',
}
params = {
'country': 'TR',
}
json_data = {
'email': '[email protected]',
'rawPassword': 'Ahmed+2349hh',
'deviceSerial': '',
'deviceType': '',
'physicalDeviceType': '',
'label': '',
'captchaToken': token,
'terms': True,
'isNewUser': False,
'subscribeToNewsLetter': False,
}
response = s.post(
'https://api2.shahid.net/proxy/v2.1/usersservice/validateLogin',
params=params,
headers=headers,
json=json_data,
)
print(response.text)
else:
print("Failed to obtain CAPTCHA token.")