From 5b62b58a3aa9f3d302c44d2d27392e61f21a5442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Fri, 2 Feb 2024 12:56:13 +0100 Subject: retries --- skripti/poprbot.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'skripti') diff --git a/skripti/poprbot.py b/skripti/poprbot.py index c10fdbf..a32101d 100755 --- a/skripti/poprbot.py +++ b/skripti/poprbot.py @@ -58,6 +58,7 @@ def main(): return sleep(180) sleep((kdaj-datetime.now()).total_seconds()-3) + retries = 0 while True: prijavi_se(s, event, slotid) if (kdaj-datetime.now()).total_seconds() < -3: @@ -66,6 +67,10 @@ def main(): print("Prijavljeni ste.") return else: + if ev["slots"][slot]["bookable"] == False: + retries += 1 + if retries < 10: + continue print("NAPAKA! Niste prijavljeni.") return prijavi_se(s, event, slotid) -- cgit v1.2.3