Use requests.status_codes.codes.TOO_MANY_REQUESTS

This commit is contained in:
Mizaki 2023-06-27 17:48:38 +01:00
parent fba5518d06
commit 37cc66cbae

View File

@ -457,7 +457,7 @@ class ComicVineTalker(ComicTalker):
time.sleep(1)
logger.debug(str(resp.status_code))
tries += 1
if resp.status_code == 429:
if resp.status_code == requests.status_codes.codes.TOO_MANY_REQUESTS:
logger.info(f"{self.name} rate limit encountered. Waiting for 10 seconds\n")
time.sleep(10)
limit_counter += 1