antigate.com/anti-captcha.com的简易包装

antigate的Python项目详细描述


文本编码的实时验证码图片:https://api.travis-ci.org/gotlium/antigate.png?branch=master
:alt:build status
:target:https://travis ci.org/gotlium/antigate
。图片::https://coveralls.io/repos/gotlium/antigate/badge.png?branch=master
:目标:https://coveralls.io/r/gotlium/antigate?分支=主
…图片::https://img.shields.io/badge/python-2.6,2.7,3.3,3.4,3.5-blue.svg
:alt:python 2.6、2.7、3.3、3.4、3.5
:目标:https://pypi.python.org/pypi/antigate/
。图片::https://img.shields.io/pypi/v/antigate.svg
:alt:pypi上的当前版本
:目标:https://pypi.python.org/pypi/antigate/
…图片::https://img.shields.io/pypi/dm/antigate.svg
:alt:downloads from pypi
:目标:https://pypi.python.org/pypi/antigate/
…图片::https://img.shields.io/badge/license-gplv2-green.svg
:目标:https://pypi.python.org/pypi/antigate/
:alt:license





`.



安装
----


代码块::bash

$git clone https://github.com/gotlium/antigate.git

$cd antigate&;python setup.py install


代码块::bash

$pip install antigate



**要求:**


您可以使用grab/requests/urllib作为http后端。

`grab'安装:

……代码块::bash




`requests`安装:

…代码块::bash




`urllib`默认使用。




----

代码块::python

>;>gate=antigate('api-key')anticaptcha('api-key')
>;>captcha_id=gate.send('captcha.jpg')
>;>print gate.get(captcha_id)



如果您希望投诉不匹配的结果,请使用"滥用"方法:

。代码块::python

>;>;来自antigate import antigate
>;>;gate=antigate('api-key','captcha.jpg')
>;>;如果str(gate)!='qwerty':
>;>>gate.usage()

代码块::python

>;>print gate.balance()




代码块::python

>;>print gate.stats()




系统加载信息:

…代码块::python

>;>;print gate.load()




api的自定义请求代码块::python

>;>;来自antigate import antigate
>;>;config={'connect_timeout':5,'timeout':60}
>;>;gate=antigate('api-key','captcha.jpg',grab_config=config)
>;print gate

验证码:

…代码块::python

>;>;来自antigate import antigate
>;>;config={'min_len':'3','max_len':'5','phrase':'2}
>;>;gate=antigate('api-key','captcha.jpg',send_config=config)
>;>;打印门

手动使用所有方法:

…代码块::python

>;>;来自antigate import antigate
>;>;gate=antigate('api-key')
>;>;captcha_id1=gate.send('captcha1.jpg')
>;>;captcha_id2=gate.send('captcha2.jpg')
>;>;>;打印门。获取(验证码ID 1)
>;>;打印门。获取(验证码ID 2)


获取多个ID的结果:

……代码块::python

>;>;gate=antigate('api-key')
>;>;captcha_id1=gate.send('captcha1.jpg')
>;>;captcha_id2=gate.send('captcha2.jpg')
>;>;print gate.get_multi([captcha_id1,如果您想使用字节或base64,请使用captcha_id2])




。代码块::python

gate=antigate('api-key')

base64
>;>;captcha\u id=gate.send(b64encode(fp.read())

或stream
>;>;captcha\u id=gate.send(fp.read())

>;打印门。获取(验证码ID)



API文档
----
https://anti-captcha.com/apidoc/http://anti gate.com/?action=api algo



兼容性
----
*python:2.6、2.7、3.3、3.4、3.5



图片::https://d2weczhvl823v0.cloudfront.net/gotlium/antigate/trend.png
:alt:bitdeli badge
:target:https://bitdeli.com/free

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在搜索二进制搜索树时遇到问题   当try block中的多行抛出异常时,java使用TryWithResources而不是finally block   java什么时候需要动态多态性(与静态多态性相比)?   从对象类型的角度来看,java的子类是否与racine类等价?   JavaSpring数据JDBConetomany关系会导致大量日志警告   Java:无法更改响应标头中的“ContentDisposition”属性   Java:我可以直接初始化函数而不将其转换为变量吗?   java do,而游标仅从数组返回3个值   java StoredProcedureQuery多输出类型   java ForLoops最大和最小数   如何在java中的任何机器上读取文本文件   java从嵌套标记中获取XML字符串中包含的值   java如何解决Spring批处理作业运行期间的连接重置异常?   我在运行时创建的java Swing组件没有显示在JPanel中   Apache Jena:Error:“java.lang.NoClassDefFoundError:org/Apache/Jena/riot/RDFDataMgr”   java访问嵌套接口数据变量   java如果CopyOnWriteArrayList中的项目被不同的线程更新和读取,我需要同步它们吗?   在Java数组中不断迭代   java组织。贾维斯。常见的例外JaversException:NOT_INSTANCE_OF:无法为EntityType创建InstanceId