From 0316e52e90a21aca7aeef0042a1aa1d6fba2ee2c Mon Sep 17 00:00:00 2001 From: Jalin Date: Fri, 3 Jan 2020 12:18:30 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20=E9=AA=8C=E8=AF=81=E7=A0=81=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=A4=B1=E8=B4=A5=EF=BC=8C=E8=BF=94=E5=9B=9E=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=BA=E7=A9=BA=20#262=20#297?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- py12306/helpers/auth_code.py | 1 + 1 file changed, 1 insertion(+) diff --git a/py12306/helpers/auth_code.py b/py12306/helpers/auth_code.py index a745485..4f11eeb 100644 --- a/py12306/helpers/auth_code.py +++ b/py12306/helpers/auth_code.py @@ -47,6 +47,7 @@ class AuthCode: url = API_AUTH_CODE_BASE64_DOWNLOAD.format(random=random.random()) # code_path = self.data_path + 'code.png' try: + self.session.cookies.clear_session_cookies() UserLog.add_quick_log(UserLog.MESSAGE_DOWNLAODING_THE_CODE).flush() # response = self.session.save_to_file(url, code_path) # TODO 返回错误情况 response = self.session.get(url)