Binance - Binance captcha
- 此任务将通过我们的代理服务器执行。
- 仅可使用您的账户登录。
请求参数
type
<string>requiredBinanceTask
websiteURL
<string>required解决 CAPTCHA 的主页面地址。
websiteKey
<string>required您网站部分的唯一参数。参数 bizId
、bizType
或 bizCode
的值。可以从流量中获取(请参见下面的描述)。
validateId
<string>required动态密钥。参数 validateId
、securityId
或 securityCheckResponseValidateId
的值。可以从流量中获取(请参见下面的描述)。
userAgent
<string>optional浏览器的 User-Agent。您可以提供自己的 User-Agent,或指定来自 Windows 操作系统的最新 User-Agent。: userAgentPlaceholder
proxyType
<string>optionalhttp - 普通的 http/https 代理;
https - 仅在 "http" 不起作用时尝试(某些自定义代理服务器要求);
socks4 - socks4 代理;
socks5 - socks5 代理。
proxyAddress
<string>optional代理 IP 地址 IPv4/IPv6。不允许:
- 使用主机名;
- 使用透明代理(其中客户端 IP 可见);
- 使用来自本地网络的代理。
proxyPort
<integer>optional代理端口。
proxyLogin
<string>optional代理登录。
proxyPassword
<string>optional代理密码。
如何获取 websiteKey
和 validateId
启用开发者工具,进入 "Network"(网络)标签,激活 CAPTCHA,然后 查看请求。有些请求会包含所需的参数值。 例如,参数:
bizCode: "CMC_register", securityId: "09295759baca4d4fbeae80d9ffeaefd8"
或者
bizId: "CMC_register", securityCheckResponseValidateId: "09295759baca4d4fbeae80d9ffeaefd8"
或者
bizType: "login", validateId: "ff965ea6216b46f3825fa827ecaf297f"
或者
bizId: "login", securityCheckResponseValidateId: "ff965ea6216b46f3825fa827ecaf297f"
要解决验证码所需的参数可以通过执行 JavaScript 获得:
let originalBCaptcha = window.BCaptcha;
let BCaptchaData;
Object.defineProperty(window, 'BCaptcha', {
get: function() {
return function(args) {
const BCaptcha = new originalBCaptcha(args);
let BCaptchaShow = BCaptcha.__proto__.show
BCaptcha.__proto__.show = function(args) {
BCaptchaData = args;
return 1;
};
return BCaptcha;
}
}
});
然后,您可以像这样检索参数,例如 BCaptchaData.securityCheckResponseValidateId
.
创建任务方法
- BinanceTask (无代理)
- BinanceTask (使用代理)
https://api.capmonster.cloud/createTask
要求
{
"clientKey": "API_KEY",
"task":
{
"type": "BinanceTask",
"websiteURL": "https://example.com",
"websiteKey": "login",
"validateId": "cb0bfefa598b4c3887661fde54ecd57b",
"userAgent": "userAgentPlaceholder"
}
}
回应
{
"errorId":0,
"taskId":407533072
}
https://api.capmonster.cloud/createTask
要求
{
"clientKey": "API_KEY",
"task":
{
"type": "BinanceTask",
"websiteURL": "https://example.com",
"websiteKey": "login",
"validateId": "cb0bfefa598b4c3887661fde54ecd57b",
"userAgent": "userAgentPlaceholder",
"proxyType":"http",
"proxyAddress":"8.8.8.8",
"proxyPort":8080,
"proxyLogin":"proxyLoginHere",
"proxyPassword":"proxyPasswordHere"
}
}
回应
{
"errorId":0,
"taskId":407533072
}
获取任务结果方法
使用方法 getTaskResult 获取币安解决方案。
https://api.capmonster.cloud/getTaskResult
要求
{
"clientKey":"API_KEY",
"taskId": 407533072
}
回应
{
"errorId":0,
"status":"ready",
"solution":
{
"token":"captcha#09ba4905a79f44f2a99e44f234439644-ioVA7neog7eRHCDAsC0MixpZvt5kc99maS943qIsquNP9D77",
"userAgent":"userAgentPlaceholder"
}
}
使用 SDK 库
- JavaScript
- Python
- C#
// https://github.com/ZennoLab/capmonstercloud-client-js
import { CapMonsterCloudClientFactory, ClientOptions, BinanceRequest /*BinanceRequest*/ } from '@zennolab_com/capmonstercloud-client';
document.addEventListener('DOMContentLoaded', async () => {
const cmcClient = CapMonsterCloudClientFactory.Create(new ClientOptions({ clientKey: '<your capmonster.cloud API key>' }));
console.log(await cmcClient.getBalance());
const binanceRequest = new BinanceRequest({
websiteURL: 'https://example.com',
websiteKey: 'websiteKey',
validateId: 'validateId',
});
// const binanceRequest = new BinanceRequest({
// websiteURL: 'https://example.com',
// websiteKey: 'websiteKey',
// validateId: 'validateId',
// proxyType: 'http',
// proxyAddress: '8.8.8.8',
// proxyPort: 8080,
// proxyLogin: 'proxyLoginHere',
// proxyPassword: 'proxyPasswordHere',
// });
console.log(await cmcClient.Solve(binanceRequest));
});
# https://github.com/ZennoLab/capmonstercloud-client-python
import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import BinanceTaskRequest
client_options = ClientOptions(api_key="your_api_key") # Replace with your CapMonster Cloud API key
cap_monster_client = CapMonsterClient(options=client_options)
binance_request = BinanceTaskRequest(
websiteUrl="https://example.com", # URL with captcha
websiteKey="login",
validateId="cb0bfefa598b4c3887661fde54ecd57b",
userAgent="userAgentPlaceholder",
proxyType="http",
proxyAddress="8.8.8.8",
proxyPort=8080,
proxyLogin="proxyLoginHere",
proxyPassword="proxyPasswordHere"
)
async def solve_captcha():
return await cap_monster_client.solve_captcha(binance_request)
responses = asyncio.run(solve_captcha())
print(responses)
// https://github.com/ZennoLab/capmonstercloud-client-dotnet
// BinanceTaskRequest:
using Zennolab.CapMonsterCloud.Requests;
using Zennolab.CapMonsterCloud;
class Program
{
static async Task Main(string[] args)
{
var clientOptions = new ClientOptions
{
ClientKey = "your_api_key" // Replace with your CapMonster Cloud API key
};
var cmCloudClient = CapMonsterCloudClientFactory.Create(clientOptions);
var binanceRequest = new BinanceTaskRequest
{
WebsiteUrl = "https://example.com",
WebsiteKey = "login",
ValidateId = "cb0bfefa598b4c3887661fde54ecd57b",
UserAgent = "userAgentPlaceholder" // Use the current userAgent
};
var binanceResult = await cmCloudClient.SolveAsync(binanceRequest);
Console.WriteLine("Captcha Solution: " + binanceResult.Solution.Value);
}
}