From 5a1ac305537839b9a7f78459903b4557d86c79d1 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Wed, 31 Aug 2022 01:43:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4ddddocr=E4=BE=9D=E8=B5=96,?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9C=A8=E7=BA=BF=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?(=E6=98=93=E8=AF=AD=E8=A8=80)=E6=8E=A5=E5=8F=A3=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands.txt | 3 +++ config.py | 3 ++- utils/encode.py | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/commands.txt b/commands.txt index 5203a41..5f7e74d 100644 --- a/commands.txt +++ b/commands.txt @@ -3,6 +3,9 @@ flask db migrate flask db upgrade supervisord -c manager.conf +pip install -i https://mirrors.cloud.tencent.com/pypi/simple --upgrade pip +pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple + 可能会用到: ddddocr==1.1.0 ; sys_platform == 'win32' ddddocr==1.0.8 ; sys_platform != 'win32' diff --git a/config.py b/config.py index 25388e6..2a8af5f 100644 --- a/config.py +++ b/config.py @@ -25,5 +25,6 @@ WALL_PAPER_ENABLE = True # 启用自定义壁纸 WALL_PAPER = "https://picsum.photos/1280/720/?blur=10" # 自定义壁纸,可注释 SUP_PORT = 9001 # supervisord 服务端口 RETRY_CNT = 3 # 验证码重试次数 -OCR_API = 'http://192.168.3.224:9000/api/ocr_img' # 验证码识别接口,传参数data +# OCR_API = 'http://192.168.3.224:9000/api/ocr_img' # 验证码识别接口,传参数data +OCR_API = 'http://dm.mudery.com:10000' # 验证码识别接口,传参数data # {% if config.WALL_PAPER %}"wallpaper":"{{ config.WALL_PAPER }}",{% endif %} \ No newline at end of file diff --git a/utils/encode.py b/utils/encode.py index 38f2fe6..06dd7ed 100644 --- a/utils/encode.py +++ b/utils/encode.py @@ -49,7 +49,8 @@ class OcrApi: def verifyCode(url,headers,timeout=5,total_cnt=3,api=None): if not api: - api = 'http://192.168.3.224:9000/api/ocr_img' + # api = 'http://192.168.3.224:9000/api/ocr_img' + api = 'http://dm.mudery.com:10000' lower_keys = list(map(lambda x: x.lower(), headers.keys())) host = getHome(url) if not 'referer' in lower_keys: -- GitLab