no-phpunit/capmonstercloud.client

该包的最新版本(dev-main)没有可用的许可证信息。

capmonster.cloud API 客户端

dev-main 2023-07-12 04:38 UTC

This package is not auto-updated.

Last update: 2024-10-03 08:50:42 UTC


README

用法

    include './client/Client.php';
    include './client/src/captcha/ImageToText.php';
    include './client/src/captcha/RecaptchaV2.php';
    include './client/src/captcha/HCaptcha.php';
    
    $client = new Client("your_client_key");

    //solve image captcha
    $body = "base64_captcha_image";
    $imageRequest = new ImageToTextRequest($body);
    $imageResult = $client->solve($imageRequest);
    
    //solve Recaptcha 2 (without proxy)
    $websiteURL = "https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high";
    $websiteKey = "6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd";
    $recaptchaV2Request = new RecaptchaV2Request($websiteURL, $websiteKey);
    $recaptchaV2Result = $client->solve($recaptchaV2Request);
    
    // solve HCaptcha (without proxy)
    $websiteUrl = "https://lessons.zennolab.com/captchas/hcaptcha/?level=easy";
    $websiteKey = "472fc7af-86a4-4382-9a49-ca9090474471";
    $hcatpchaRequest = new HCaptchaRequest($websiteURL, $websiteKey);
    $hcaptchaResult = $client->solve($hcatpchaRequest);

响应格式

solve 方法的返回结果总是包含两个字段:bool result,表示请求成功与否的指示器,以及一个包含错误文本描述或服务器成功响应对象的 mixed message 字段。

支持的验证码类型

  • FunCaptchaTask
  • FunCaptchaTaskProxyless
  • GeeTestTask
  • GeeTestTaskProxyless
  • HCaptchaTask
  • HCaptchaTaskProxyless
  • ImageToTextTask
  • RecaptchaV2Task
  • RecaptchaV2TaskProxyless
  • RecaptchaV3TaskProxyless
  • RecaptchaV2EnterpriseTask
  • RecaptchaV2EnterpriseTaskProxyless
  • TurnstileTask
  • TurnstileTaskProxyless
  • ComplexImageRecaptcha
  • ComplexImageHCaptcha
  • ComplexImageFuncaptcha