当检测到验证码时,强制结束程序。
This commit is contained in:
@@ -25,6 +25,8 @@ def login(url, username, password):
|
|||||||
if cookies == {}:
|
if cookies == {}:
|
||||||
lgn = student_client.login(username, password)
|
lgn = student_client.login(username, password)
|
||||||
if lgn["code"] == 1001:
|
if lgn["code"] == 1001:
|
||||||
|
sys.exit("你的教务系统登录需要验证码,因此你无法使用此项目。")
|
||||||
|
"""
|
||||||
verify_data = lgn["data"]
|
verify_data = lgn["data"]
|
||||||
with open(os.path.abspath("kaptcha.png"), "wb") as pic:
|
with open(os.path.abspath("kaptcha.png"), "wb") as pic:
|
||||||
pic.write(base64.b64decode(verify_data.pop("kaptcha_pic")))
|
pic.write(base64.b64decode(verify_data.pop("kaptcha_pic")))
|
||||||
@@ -34,6 +36,7 @@ def login(url, username, password):
|
|||||||
pprint(ret)
|
pprint(ret)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
pprint(ret)
|
pprint(ret)
|
||||||
|
"""
|
||||||
elif lgn["code"] != 1000:
|
elif lgn["code"] != 1000:
|
||||||
pprint(lgn)
|
pprint(lgn)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|||||||
Reference in New Issue
Block a user