From 91c0a44a32ab6012089517daeb3a15a3a578fd10 Mon Sep 17 00:00:00 2001 From: Weey Date: Thu, 19 Sep 2019 21:59:07 +0800 Subject: [PATCH] set timeout of OCR --- py12306/helpers/OCR.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py12306/helpers/OCR.py b/py12306/helpers/OCR.py index 0345d0b..a20f6bd 100644 --- a/py12306/helpers/OCR.py +++ b/py12306/helpers/OCR.py @@ -58,7 +58,7 @@ class OCR: data = { 'img': img } - response = self.session.post(API_FREE_CODE_QCR_API, data=data) + response = self.session.post(API_FREE_CODE_QCR_API, data=data, timeout=30) result = response.json() if result.get('msg') == 'success': pos = result.get('result')