定制 randock/anti-captcha-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

randock/anti-captcha-client

Composer 安装命令:

composer require randock/anti-captcha-client

包简介

A PHP library to connect to https://anti-captcha.com

README 文档

README

Build Status

Anti-captcha API

This library integrates the https://anti-captcha.com API in PHP.

Installing

The easiest way to install the library is using composer:

composer require randock/anti-captcha-client

Usage

The library can be used by creating an instance of the client and calling the appropriate methods.

For example, to create a new task:

<?php

use Randock\AntiCaptcha\Client;
use Randock\AntiCaptcha\Task\ImageToTextTask;
use Randock\AntiCaptcha\Solution\ImageToTextSolution;
use Randock\AntiCaptcha\Exception\InvalidRequestException;

// create a new client
$client = new Client('<<API KEY>>');

// create the task to be send
$task = new ImageToTextTask();

// set the body
$task->setBody('<<BASE 64 of captcha>>');
//$task->setBodyFromFile($file);

try {
    // send the task to anti-captcha.com
    $task = $client->createTask($task);

    do {
        // wait a bit before (re)trying
        sleep(2);

        $taskResult = $client->getTaskResult($task);
    } while ($taskResult->isProcessing());

    /* @var ImageToTextSolution $solution */
    $solution = $taskResult->getSolution();

    // grab captcha text
    $captcha = $solution->getText();
} catch (InvalidRequestException $exception) {
}

统计信息

  • 总下载量: 7.39k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 5
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-06-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固