From f41b79b647f016297a396ba093d350de3983e3ff Mon Sep 17 00:00:00 2001 From: MOIS3Y Date: Sun, 25 Sep 2022 19:06:53 +0900 Subject: [PATCH] Add a timeout between requests to get a key --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 813d11a..b9204b5 100644 --- a/main.py +++ b/main.py @@ -3,6 +3,7 @@ __author__ = 'MOIS3Y' import requests +from time import sleep from models_vm import VmAccount from models_dci import AuthUser from settings import CLIENT_HOST, PLATFORM @@ -82,9 +83,10 @@ class Access(object): answer = req.json() key = answer['key'] print("Key will be used:") - print(key, "\n") + print(answer, "\n") break except Exception: + sleep(2) check_key += 1 key = 'not_found_try_again' return key