BotDeflector: BotDeflector को हल करना
टिप
टास्क को createTask मेथड से बनाएं और getTaskResult मेथड से परिणाम प्राप्त करें।
टास्क प्रकार type इस प्रकार है
AntiBotdeflectorTaskProxyLess
टास्क बनाएं
createTask के साथ टास्क बनाएं।
टास्क ऑब्जेक्ट संरचना
| प्रॉपर्टीज़ | टाइप | आवश्यक | विवरण |
|---|---|---|---|
| type | String | आवश्यक | AntiBotdeflectorTaskProxyLess |
| websiteURL | String | आवश्यक | वर्तमान वेबसाइट के मुख्य पृष्ठ का URL |
| domain | String | आवश्यक | एंडपॉइंट pow/get या icon/get द्वारा उपयोग किया जाने वाला डोमेन नाम उदाहरण के लिए: botdeflector.eu |
| flowToken | String | आवश्यक | साइट पर, इसे botReflectorJwtToken कहा जा सकता है, उदाहरण के लिए: eyJhbGciOiJ। . . |
ध्यान
पैरामीटर domain और पैरामीटर websiteURL जरूरी नहीं हो सकते हैं एक ही डोमेन नाम, कृपया उन्हें अलग करें।
उदाहरण अनुरोध
POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "AntiBotdeflectorTaskProxyLess", // आवश्यक
"websiteURL": "https://exaple.com/", // आवश्यक
"domain":"exaple.com", // आवश्यक
"flowToken":"eyJhbGciOiJI1...", // आवश्यक
}
}उदाहरण रिस्पॉन्स
{
"errorId": 0,
"errorCode": "",
"errorDescription": "",
"taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}परिणाम प्राप्त करना
पहचान परिणाम प्राप्त करने के लिए getTaskResult विधि का उपयोग करें
वेबसाइट और प्रॉक्सी के आधार पर, आपको 1s से 20s के अंतराल के भीतर परिणाम मिलेंगे
उदाहरण अनुरोध
POST https://api.capsolver.com/getTaskResult
Host: api.capsolver.com
Content-Type: application/json
{
"clientKey": "YOUR_API_KEY",
"taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}उदाहरण रिस्पॉन्स
{
"errorId": 0,
"taskId": "646825ef-9547-4a29-9a05-50a6265f9d8a",
"status": "ready",
"solution": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50SWQiOiI1ZmMyOGEwMi04Z..."
}
}SDK अनुरोध का उपयोग करें
# pip install --upgrade capsolver
# export CAPSOLVER_API_KEY='...'
import capsolver
# capsolver.api_key = "..."
solution = capsolver.solve({
"type": "AntiBotdeflectorTaskProxyLess",
"websiteURL": "https://exaple.com/",
"domain":"exaple.com",
"flowToken":"eyJhbGciOiJI1...",
})नमूना कोड
# pip install requests
import requests
import time
api_key = "YOUR_API_KEY" # your api key of capsolver
def capsolver():
payload = {
"clientKey": api_key,
"task": {
"type": "AntiBotdeflectorTaskProxyLess",
"websiteURL": "https://exaple.com/",
"domain":"exaple.com",
"flowToken":"eyJhbGciOiJI1...",
}
}
res = requests.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
print(f"Got taskId: {task_id} / Getting result...")
while True:
time.sleep(1) # delay
payload = {"clientKey": api_key, "taskId": task_id}
res = requests.post("https://api.capsolver.com/getTaskResult", json=payload)
resp = res.json()
status = resp.get("status")
if status == "ready":
return resp.get("solution", {}).get("token")
if status == "failed" or resp.get("errorId"):
print("Solve failed! response:", res.text)
return
token = capsolver()
print(token)