From 7e17166037641096544368472b271e6e22784dc0 Mon Sep 17 00:00:00 2001 From: LuXeZs <49080760+LuXeZs@users.noreply.github.com> Date: Tue, 20 Jun 2023 07:22:10 +0100 Subject: [PATCH] Fix for issue mentioned in #65 Signed-off-by: LuXeZs <49080760+LuXeZs@users.noreply.github.com> --- src/backend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend.py b/src/backend.py index 0ebebf3..51fee28 100644 --- a/src/backend.py +++ b/src/backend.py @@ -166,13 +166,13 @@ def codeEntry( statistics['attemptedCodeCount'] += 1 time.sleep(0.3) # Wait for page to update so we can detect changes such as rate limited. - if ('The resource is being rate limited.' in driver.page_source): + while ('The resource is being rate limited.' in driver.page_source): sleepDuration = secrets.choice(range(7, 12)) statistics['ratelimitCount'] += 1 print(f"Code: {color(totpCode, 'blue')} was {color('Ratelimited', 'yellow')} will retry in {color(sleepDuration, 'blue')}") time.sleep(sleepDuration) loginFields['TOTP'].send_keys(Keys.RETURN) - sleepDuration = secrets.choice(range(6, 10)) + time.sleep(0.3) if ('Token has expired' in driver.page_source): #Print this out as well as some statistics, and prompt the user to retry.