diff --git a/py12306/helpers/OCR.py b/py12306/helpers/OCR.py index b376fa8..af9be61 100644 --- a/py12306/helpers/OCR.py +++ b/py12306/helpers/OCR.py @@ -60,9 +60,9 @@ class OCR: } response = self.session.post(API_FREE_CODE_QCR_API, json=data) result = response.json() - if result.get('success') and result.get('check'): + if result.get('success') and result.get('data.check'): check_data = { - 'check': result.get('check'), + 'check': result.get('data.check'), 'img_buf': img, 'logon': 1, 'type': 'D' diff --git a/py12306/helpers/api.py b/py12306/helpers/api.py index 304b258..1a9dc04 100644 --- a/py12306/helpers/api.py +++ b/py12306/helpers/api.py @@ -44,7 +44,8 @@ API_QUERY_INIT_PAGE = BASE_URL_OF_12306 + '/otn/leftTicket/init' API_NOTIFICATION_BY_VOICE_CODE = 'http://ali-voice.showapi.com/sendVoice?' API_NOTIFICATION_BY_VOICE_CODE_DINGXIN = 'http://yuyin2.market.alicloudapi.com/dx/voice_notice' -API_FREE_CODE_QCR_API = 'http://60.205.200.159/api' +# API_FREE_CODE_QCR_API = 'http://60.205.200.159/api' # 19-03-07 接口已失效 +API_FREE_CODE_QCR_API = 'https://12306.jiedanba.cn/api/v2/getCheck' API_FREE_CODE_QCR_API_CHECK = 'http://check.huochepiao.360.cn/img_vcode' API_CHECK_CDN_AVAILABLE = 'https://{}/otn/dynamicJs/omseuuq'