Unverified Commit acc72056 authored by antares's avatar antares Committed by GitHub
Browse files

print location信息,tgbot可以提示打卡位置 (#4)

* fix: dllt从qrcode改为username-password

* add location to data

* fix
parent 45752083
......@@ -19,7 +19,8 @@ def main():
return ''.join(random.choices(_chars, k=len))
def _gas(data: str, key0: str, iv0: str) -> bytes:
encrypt = AES.new(key0.strip().encode('utf-8'), AES.MODE_CBC, iv0.encode('utf-8'))
encrypt = AES.new(key0.strip().encode('utf-8'),
AES.MODE_CBC, iv0.encode('utf-8'))
return base64.b64encode(encrypt.encrypt(Padding.pad(data.encode('utf-8'), 16)))
return _gas(_rds(64) + _p0, _p1, _rds(16)).decode('utf-8')
......@@ -62,7 +63,10 @@ def main():
result = session.get('http://ehallapp.nju.edu.cn/xgfw/sys/yqfxmrjkdkappnju/apply/saveApplyInfos.do?' +
'&'.join([key + '=' + data[key] for key in fields]))
print(result.text)
answer = json.loads(result.text)
answer['location'] = data['CURR_LOCATION']
print(answer)
if result.status_code != 200:
exit(1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment