From b9fb40a9f53b7633a8f899c9653fc9ea5bd1fc37 Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Thu, 24 Feb 2022 13:32:59 -0600 Subject: [PATCH] Add HTTP 429 error handling --- parsers/modrinth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parsers/modrinth.py b/parsers/modrinth.py index e61ad21..d9b5f46 100644 --- a/parsers/modrinth.py +++ b/parsers/modrinth.py @@ -23,7 +23,7 @@ def failCheck(response, functOrigin): print("Status Code is: "+str(response.status_code)) if response.status_code == 429: print("Too many requests!") - time.sleep(int(response.headers["Retry-After"])) + time.sleep(15) # Wait 15 seconds print("Retrying "+functOrigin+"...") return True elif response.status_code != 200: