<?php
$request_body = file_get_contents('php://input');
$request_body = json_decode($request_body, true);
$cookie_file = 'roblox_cookies.txt';
function get_csrf_token($cookie_file) {
$csrf_url = "https://www.roblox.com";
$csrf_headers = ["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"];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $csrf_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $csrf_headers);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
$csrf_response = curl_exec($ch);
curl_close($ch);
preg_match('/meta name="csrf-token" data-token="(.*?)"/', $csrf_response, $matches);
$csrf_token = $matches[1] ?? null;
return $csrf_token;
}
function continue_load($challengeId, $unifiedCaptchaId, $captchaToken, $actionType, $challengeType, $csrf_token, $cookie_file) {
$login_url = "https://apis.roblox.com/challenge/v1/continue";
$login_data = [
"challengeId" => $challengeId,
"challengeMetadata" => json_encode([
"unifiedCaptchaId" => $unifiedCaptchaId,
"captchaToken" => $captchaToken,
"actionType" => $actionType
]),
"challengeType" => $challengeType
];
$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",
"X-Csrf-Token: " . $csrf_token,
"Origin: https://www.roblox.com",
"Referer: https://www.roblox.com/",
"Accept: application/json"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($login_data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);
return [
'response' => $response,
'http_code' => $http_code,
'error' => $error,
'sent_data' => $login_data
];
}
$csrf_token = get_csrf_token($cookie_file);
$result = continue_load(
$request_body['challengeId'] ?? '',
$request_body['unifiedCaptchaId'] ?? '',
$request_body['captchaToken'] ?? '',
"Login",
"captcha",
$csrf_token,
$cookie_file
);
echo json_encode($result);
?>
{
""status Code": 403,
"statusText": "Forbidden",
"errors": [
{
"code": 1,
"message": "an internal error occurred"
}
]
}
Сколько бы я не пробовал что либо менять, добавлять и так далее - ничего не помогает, я уже не знаю, что делать.
Ответы от ии - идут лесом.
Код: