diff --git a/libs/drpy2.js b/libs/drpy2.js index feb4ec050b3a8601318758e511c06cb5414a6791..3468fe481996de81a195c5dcc4c3e34d2222f570 100644 --- a/libs/drpy2.js +++ b/libs/drpy2.js @@ -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 diff --git a/static/img/yzm.png b/static/img/yzm.png new file mode 100644 index 0000000000000000000000000000000000000000..9eb03dc6b99faca6b2a95eb086a7f749eac470cb Binary files /dev/null and b/static/img/yzm.png differ diff --git "a/test/\346\265\213\350\257\225OCR.py" "b/test/\346\265\213\350\257\225OCR.py" index 453f0fe7b3b872a2f22afbc1076e2a2bf2f9251d..024baf5fa9b0fe01151d442445f3b0955b30d3ed 100644 --- "a/test/\346\265\213\350\257\225OCR.py" +++ "b/test/\346\265\213\350\257\225OCR.py" @@ -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 diff --git "a/txt/js/origin/\345\216\237\345\247\213JS.js" "b/txt/js/origin/\345\216\237\345\247\213JS.js" index d6c82095f5e640996bafcf1276e36ed8f044166e..0c8d577bf4845fdf9a5284da442b574de58e1129 100644 --- "a/txt/js/origin/\345\216\237\345\247\213JS.js" +++ "b/txt/js/origin/\345\216\237\345\247\213JS.js" @@ -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,