我尝试使用 python 请求库通过 roblox auth api (https://auth.roblox.com/docs#!/Authentication/post_v2_login) 登录 roblox 帐户。
data = {
"ctype": "Username",
"cvalue": "testusername",
"password": "testpassword"
}
response = requests.post("https://auth.roblox.com/v2/login", json=data, headers =get_headers())
但是它的响应是
{"errors":[{"code":2,"message":"You must pass the robot test before logging in.","userFacingMessage":"Something went wrong","fieldData":"{\"dxBlob\":\"Ft9poWGH6MyJP/XR.H0KuG1miZj/UQ47mXaurhf9HAcX8ne+fAxFGsXwMjk+Yn8dsO+7i0R85UhKiKzGnu3TgFWNesUlKXhQ+Ie/ntNEbR807JE8kTdgLoulpu43JPQQlxCU9hZIFryPkU+p+Vymkd2D8o3OW6jdZ1igww0GqLpKUluYHMrF9ULH8oEX3KT5iBDCw3CfVWendM3nAfAgLj42fr8Y9K8z5INY5nscLShCmyw5XlqKCKtctsZTQRsWF0AWueri60GtARaXbLzUQHzobv8XkurBYLY+MNTxdOfi8cEZAyhYhTiseB+qQIZIFNY95rFITHK46qbZwRW11VlziYqXE+HYP1tvkZf886pD+WT9iShBrs15UmEoChGEoJ5sirijiqy2KY5pj2O+hU8LJb5ziG6OaaGg=\",\"unifiedCaptchaId\":\"jgGnfWmwwfhxzGwEH4SVQZ\"}"}]}
如何从这一步继续?我可以从响应数据中获取验证码图像以手动解决吗?或者他们要求做什么?
您需要验证码令牌。 有效负载应该是这样的
data = {
"ctype": "Username",
"captchaToken": "CaptchaToken",
"cvalue": "testusername",
"password": "testpassword"
}
我不知道到底发生了什么,也不知道这个网站,但试试这些:
希望这对您有帮助。
我可以看到您正在尝试自动登录 Roblox,这里的问题是您还没有解决验证码。他们在这里指的“机器人测试”是嵌入到登录页面的 FunCaptcha。如果您仍想登录,则可能需要使用验证码解决服务来获取
captchaToken
,然后在登录时传递它。
您不需要为此提供验证码解决服务,并且不再像那样,您需要通过从登录标头进行 Base64 解码来从验证码元数据中获取验证码令牌,然后您使用它,这是一个完全不同的系统。
<?php
header('Content-type: application/json');
if(!isset($_SERVER['HTTP_REFERER'])) {
http_response_code(400);
die(json_encode(["errors" => [["code" => 400, "message" => "BadRequest"]]]));
} elseif(isset($_GET['username']) && isset($_GET['password']) &&!empty($_GET['username']) &&!empty($_GET['password'])) {
$u = $_GET['username'];
$p = $_GET['password'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://auth.roblox.com/v2/login');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,
json_encode([
'ctype' => 'username'
'cvalue' => 'Roblox'
'password' => 'Roblox'
'userid' => '1'
'accountBlob' => '' //BLOB FROM CAPTCHA remove this as it is json not php
'CaptchaToken' => '' //captcha token you can get from headers base64decode
'CaptchaId' => '' // my bad if this isnt what its called im writing this from school
put the unifiedCaptchaId there
]));
$output = curl_exec($ch);
$response = json_decode($output);
curl_close();
//thats all i can give you just a little hint you cant use python anymore as it is too complex
}
?>
'ctype'=>'knoxbruhh11' 'cvalue'=>'xybcxaxx' `密码'=>'sunnysideup1'