Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Neuer cookie wenn Buchung/Code bestätigen fehlschlägt
Browse files Browse the repository at this point in the history
  • Loading branch information
sinun98 committed May 27, 2021
1 parent 2017cac commit 19bd9cf
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions tools/its.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,17 @@ def termin_buchen(self):

elif res.status_code == 429:
msg = "Anfrage wurde von der Botprotection geblockt."
self.log.error(msg)
self.renew_cookies_code()
res = self.s.post(self.domain + path, json=data, timeout=15)
if res.status_code == 201:
msg = "Termin erfolgreich gebucht!"
self.log.success(msg)
desktop_notification(operating_system=self.operating_system, title="Terminbuchung:", message=msg)
return True
else:
return False

elif res.status_code >= 400:
data = res.json()
try:
Expand Down Expand Up @@ -684,13 +695,18 @@ def code_bestaetigen(self, token, sms_pin):
"smspin": sms_pin

}
res = self.s.post(self.domain + path, json=data, timeout=15)
if res.ok:
self.log.success("Der Impf-Code wurde erfolgreich angefragt, bitte prüfe deine Mails!")
return True
else:
self.log.error(f"Code-Verifikation fehlgeschlagen: {res.text}")
return False
while True:
res = self.s.post(self.domain + path, json=data, timeout=15)
if res.ok:
self.log.success("Der Impf-Code wurde erfolgreich angefragt, bitte prüfe deine Mails!")
return True
elif res.status_code == 429:
self.log.error(
"Cookies müssen erneuert werden.")
self.renew_cookies_code()
else:
self.log.error(f"Code-Verifikation fehlgeschlagen: {res.text}")
return False

@staticmethod
def terminsuche(code: str, plz_impfzentren: list, kontakt: dict, PATH: str, check_delay: int = 30):
Expand Down

0 comments on commit 19bd9cf

Please sign in to comment.