字段名称 | 字段说明 | 类型 | 必填 | 备注 |
---|---|---|---|---|
token | string | Y | token | |
image | 图片二进制字符串 | string | Y | 图片 |
5) 百度旋转验证码识别易语言代码演示:
链接:https://pan.baidu.com/s/1r71ywg5T4s-21tnJq_9SpA?pwd=uzfc
提取码:uzfc
import base64,requests,time,json# 打码token token='' # 图片content with open('./1.png', 'rb')as f: image=f.read() f.close()# 二进制加密 base64_data = base64.b64encode(image) b64 = base64_data.decode() b64 = str(base64_data) #或者如下转为字符串类型 urlt = 'https://d175582r32.oicp.vip/api/baiducor' data = { 'token': token, 'image': b64} try: response = requests.post(urlt, data=json.dumps(data)) print(response.json()) # {'status': 0, 'msg': 'success', 'point': '254','px':'88', 'remain': '22798', 'totle': '60000'} # {'status': 1, 'msg': '服务器过载'} 请求失败 # {'status': 2, 'msg': '非法token'} token错误或者为空 # {'status': 4, 'msg': '打码点数不足'} if response.json()['status'] == 0: point = response.json()['point'] except: time.sleep(1)
百度旋转验证码接口调用接口2
1) 请求地址
字段名称 | 字段说明 | 类型 | 必填 | 备注 |
---|---|---|---|---|
file | 图片字节集 | string | Y | 图片 |
6) python代码演示
token='g3hwae39nqbvgmj72q3n47fa46r4ei6l' urlt = 'https://d175582r32.oicp.vip/api/baiducor1?token='+token with open('./1.png', 'rb')as f: file=f.read() f.close() response = requests.post(urlt,files={'file':file})
7) 失败请求返回结果:
{'status': 1, 'msg': '服务器过载'} 请求失败 {'status': 2, 'msg': '非法token'} token错误或者为空 {'status': 4, 'msg': '打码点数不足'}
{'status': 0, 'msg': 'success', 'point': '254','px':'88', 'remain': '22798', 'totle': '60000'}
字段名称 | 字段说明 | 类型 | 必填 | 备注 |
---|---|---|---|---|
status | string | Y | ||
point | string | Y | 图片角度 | |
px | string | Y | 移动距离 | |
remain | string | Y | 剩余打码 | |
totle | string | Y | 打码总数 |
百度旋转验证码接口调用接口3
1) 请求地址
字段名称 | 字段说明 | 类型 | 必填 | 备注 |
---|---|---|---|---|
ck | 字符串 | string | Y | 百度账号cookies |
6) python代码演示
import requests url = "https://www.sonnde.com/api/tkds" querystring = {"token":"g3hwae39nqbvgmj72q3n47fa46r4ei6l"} payload = {"ck": "BDUSS=UzTFVZQ0ZNQldrUUZWM2M1fmswb0phVXBJbUt1SnVKeGx4Yn5TcE1JTk5LakJqSUFBQUFBJCQAAAAAAAAAAAEAAAA7gUEUNjk1NDc3NjI1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE2dCGNNnQhjan;"} headers = {"content-type": "application/json"} response = requests.request("POST", url, json=payload, headers=headers, params=querystring) print(response.text)
7) 失败请求返回结果:
{'status': 1, 'msg': '服务器过载'} 请求失败 {'status': 2, 'msg': '非法token'} token错误或者为空 {'status': 3, 'msg': '非法ck'} ck错误或者为空 {'status': 4, 'msg': '打码点数不足'}