试用了阿里云市场的验证码识别api,真的牛批,传统4位数验证码识别率超高

来源:互联网 发布:shopee123软件怎么样 编辑:程序博客网 时间:2024/06/05 02:02

有钱是真的可以为所欲为


以后阿里云的api平台的确可以占有部分市场

验证码:


引入base64模块,识别后,传入此api


host = 'https://a************.showapi.com'
path = '/checkcode'
method = 'POST'
appcode = '***************************'
querys = ''
bodys = {}
url = host + path


bodys['convert_to_jpg'] = '0'
bodys['img_base64'] =ls_f
bodys['typeId'] = '14'
post_data = urllib.urlencode(bodys)
request = urllib2.Request(url, post_data)
request.add_header('Authorization', 'APPCODE ' + appcode)
#根据API的要求,定义相对应的Content-Type
request.add_header('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8')
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
response = urllib2.urlopen(request, context=ctx)
content = response.read()
if (content):
    print(content)

输出结果:
{"showapi_res_code":0,"showapi_res_error":"","showapi_res_body":{"Result":"8028","ret_code":0,"Id":"4a0909f1-019c-4cb5-834e-15a4e97fd32c"}}



原创粉丝点击