Capsolver

# pip install requests

import requests
import time

# TODO: Set your configuration
api_key = "YOUR_API_KEY"  # Your CapSolver API key
site_key = "XXX"  # The site key for the target CAPTCHA
site_url = ""  # URL of the page with the CAPTCHA

def capsolver():
    payload = {
        "clientKey": api_key,
        "task": {
            "type": 'ReCaptchaV2TaskProxyLess',
            "websiteKey": site_key,
            "websiteURL": site_url
        }
    }

    response = requests.post("https://api.capsolver.com/createTask", json=payload)
    result = response.json()
    task_id = result.get("taskId")

    if not task_id:
        print("Failed to create task:", response.text)
        return

    print(f"Task ID received: {task_id} / Fetching result...")

    while True:
        time.sleep(3)  # Delay between checks

        payload = {"clientKey": api_key, "taskId": task_id}
        response = requests.post("https://api.capsolver.com/getTaskResult", json=payload)
        result = response.json()
        status = result.get("status")

        if status == "ready":
            return result.get("solution", {}).get('gRecaptchaResponse')

        if status == "failed" or result.get("errorId"):
            print("Solution retrieval failed! Response:", response.text)
            return

token = capsolver()
print(token)
      
        

      

Share article: