Update cowin.py

This commit is contained in:
roShan 2021-06-04 00:21:04 +05:30 committed by GitHub
parent e7f6c6dc24
commit 7285800e76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -216,7 +216,7 @@ class CoWinBook():
print(f'Waiting for OTP {i} sec') print(f'Waiting for OTP {i} sec')
self.set_cursor() self.set_cursor()
d1 = datetime.strptime(last_msg.get("received","2019-12-01 09:09"), '%Y-%m-%d %H:%M') d1 = datetime.strptime(last_msg.get("received","2019-12-01 09:09:09"), '%Y-%m-%d %H:%M:%S')
d2 = datetime.now() # current date and time d2 = datetime.now() # current date and time
diff = (d2 - d1).total_seconds() diff = (d2 - d1).total_seconds()
if (curr_msg_body != last_msg_body and "cowin" in last_msg_body.lower()) or diff <= OTP_VALID_DURATION_SECONDS: if (curr_msg_body != last_msg_body and "cowin" in last_msg_body.lower()) or diff <= OTP_VALID_DURATION_SECONDS: