diff --git a/clock-in.py b/clock-in.py index 941f010..be71912 100644 --- a/clock-in.py +++ b/clock-in.py @@ -8,7 +8,7 @@ import datetime import time import sys -import ddddocr +# import ddddocr class ClockIn(object): @@ -34,7 +34,7 @@ def __init__(self, username, password): self.username = username self.password = password self.sess = requests.Session() - self.ocr = ddddocr.DdddOcr() +# self.ocr = ddddocr.DdddOcr() def login(self): """Login to ZJU platform""" @@ -69,12 +69,12 @@ def get_date(self): today = datetime.date.today() return "%4d%02d%02d" % (today.year, today.month, today.day) - def get_captcha(self): - """Get CAPTCHA code""" - resp = self.sess.get(self.CAPTCHA_URL) - captcha = self.ocr.classification(resp.content) - print("验证码:", captcha) - return captcha +# def get_captcha(self): +# """Get CAPTCHA code""" +# resp = self.sess.get(self.CAPTCHA_URL) +# captcha = self.ocr.classification(resp.content) +# print("验证码:", captcha) +# return captcha def get_info(self, html=None): """Get hitcard info, which is the old info with updated new time.""" @@ -117,7 +117,12 @@ def get_info(self, html=None): new_info['jcqzrq'] = "" new_info['gwszdd'] = "" new_info['szgjcs'] = "" - # new_info['verifyCode'] = self.get_captcha() + + # 2022.05.07 + # new_info['verifyCode'] = self.get_captcha() # 验证码识别(已取消) + + # 2022.07.05 + new_info['internship'] = 3 # 今日是否进行实习或实践 # 2021.08.05 Fix 2 magics = re.findall(r'"([0-9a-f]{32})":\s*"([^\"]+)"', html)