提交 14aad948 编写于 作者: H hjdhnx

ocr从入门到放弃,壳子不支持alist的接口,只能自行建立接口实现,难受。不折腾了

上级 64f9cc20
......@@ -52,6 +52,7 @@ const VERSION = vercode+' 3.9.39beta1 20230316';
* 6.base64Encode,base64Decode,md5函数还没有实现 (抄影魔代码实现了)
* 7.eval(getCryptoJS());还没有实现 (可以空实现了,以后遇到能忽略)
* done: jsp:{pdfa,pdfh,pd},json:{pdfa,pdfh,pd},jq:{pdfa,pdfh,pd}
* 8.req函数不支持传递字符串的data参数 {'content-type':'text/plain'} 类型数据,因此无法直接调用alist的ocr接口
* * 电脑看日志调试
adb tcpip 5555
adb connect 192.168.10.192
......
......@@ -18,6 +18,7 @@ def test():
with open('yzm1.png',mode='rb') as f:
img = f.read()
try:
print(base64.b64encode(img).decode())
# code = requests.post(api, data=base64.b64encode(img).decode(), headers={'user-agent': PC_UA}, verify=False).text
# code = requests.post(api, data=base64.b64encode(img).decode(), headers={'user-agent': PC_UA}, verify=False).text
code = requests.post(api3, data={"img":base64.b64encode(img).decode()}, headers={'user-agent': PC_UA}, verify=False).text
......
......@@ -66,6 +66,13 @@ function play(flag, id, flags) {
function search(wd, quick) {
console.log("search");
let yzm_url = 'http://192.168.10.99:57051/static/img/yzm.png';
console.log('测试验证码地址:',yzm_url);
let img_base64 = req(yzm_url,{buffer:2}).content;
console.log(img_base64);
// const res = req('https://api.nn.ci/ocr/b64/text', {body:img_base64,method:'POST'});
const res = req('https://api.nn.ci/ocr/b64/text', {data:img_base64,method:'POST',headers:{'content-type':'text/plain'}});
console.log('验证码识别结果:',res.content);
let d = [];
d.push({
vod_name:wd,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册