TenDI - Captcha da Tencent
Essa tarefa será realizada usando nossos servidores proxy.
Parâmetros da solicitação
type
<string>requiredCustomTask
class
<string>requiredTenDI
websiteURL
<string>requiredO endereço da página principal onde o captcha é resolvido.
websiteKey
<string>requiredcaptchaAppId. Por exemplo, "websiteKey": "189123456"
é um parâmetro único para seu site. Você pode obtê-lo de uma página HTML com captcha ou a partir do tráfego (veja a descrição abaixo).
userAgent
<string>optionalO User-Agent do navegador. Passe apenas o UA real de um sistema operacional Windows. Atualmente, a versão é: userAgentPlaceholder
proxyType
<string>optionalhttp - proxy regular http/https;
https - use essa opção apenas se "http" não funcionar (necessário para alguns proxies personalizados);
socks4 - proxy socks4;
socks5 - proxy socks5.
proxyAddress
<string>optionalEndereço IP do proxy IPv4/IPv6. Não permitido:
- uso de nomes de host;
- uso de proxies transparentes (onde é possível ver o IP do cliente);
- uso de proxies em máquinas locais.
proxyPort
<integer>optionalPorta do proxy.
proxyLogin
<string>optionalLogin do servidor proxy.
proxyPassword
<string>optionalSenha do servidor proxy.
Como obter websiteKey (captchaAppId)
Ative as ferramentas de desenvolvedor, vá para a aba "Network", ative o captcha e veja as solicitações. Algumas delas conterão o valor do parâmetro que você precisa. Nesse caso, websiteKey=aid
Método de criação da tarefa
https://api.capmonster.cloud/createTask
Solicitação
{
"clientKey": "API_KEY",
"task": {
"type": "CustomTask",
"class": "TenDI",
"websiteURL": "https://example.com",
"websiteKey": "189123456",
"userAgent": "userAgentPlaceholder"
}
}
Resposta
{
"errorId":0,
"taskId":407533072
}
Método de obter resultado da tarefa
Use o método getTaskResult para obter a solução do TenDI.
https://api.capmonster.cloud/getTaskResult
Solicitação
{
"clientKey":"API_KEY",
"taskId": 407533072
}
Resposta
{
"errorId":0,
"status":"ready",
"solution": {
"data": {
"randstr": "@EcL",
"ticket": "tr03lHUhdnuW3neJZu.....7LrIbs*"
},
"headers": {
"User-Agent": "userAgentPlaceholder"
}
}
}
Usar biblioteca SDK
- JavaScript
- Python
- C#
// https://github.com/ZennoLab/capmonstercloud-client-js
import { CapMonsterCloudClientFactory, ClientOptions, TenDIRequest } 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 tenDIRequest = new TenDIRequest({
websiteURL: 'https://example.com',
websiteKey: 'websiteKey',
});
console.log(await cmcClient.Solve(tenDIRequest));
});
# https://github.com/ZennoLab/capmonstercloud-client-python
import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import TenDiCustomTaskProxylessRequest
client_options = ClientOptions(api_key="your_api_key") # Replace with your CapMonster Cloud API key
cap_monster_client = CapMonsterClient(options=client_options)
ten_di_request = TenDiCustomTaskProxylessRequest(
websiteUrl="https://example.com", # URL with the captcha
websiteKey="189956587", # Replace with the website key for the captcha
userAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" # Use the current userAgent
)
async def solve_captcha():
return await cap_monster_client.solve_captcha(ten_di_request)
responses = asyncio.run(solve_captcha())
print(responses)
// https://github.com/ZennoLab/capmonstercloud-client-dotnet
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 tenDiRequest = new TenDiCustomTaskProxylessRequest
{
WebsiteUrl = "https://example.com", // URL with the captcha
WebsiteKey = "189956587", // Replace with the correct website key
UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" // Use the current userAgent
};
var tenDiRequestResult = await cmCloudClient.SolveAsync(tenDiRequest);
Console.WriteLine("Captcha Solution: " + string.Join(", ", tenDiRequestResult.Solution.Data));
Console.WriteLine("Captcha Solution: " + string.Join(", ", tenDiRequestResult.Solution.Headers));
}
}