diff --git a/renew.py b/renew.py index 8c41cb59..614c644d 100644 --- a/renew.py +++ b/renew.py @@ -33,7 +33,7 @@ def get_user_agent(): r = requests.get(url="https://jnrbsn.github.io/user-agents/user-agents.json") if r.status_code == 200 and len(list(r.json())) > 0: agents = r.json() - return list(agents).pop(random.randint(0, len(agents))) + return list(agents).pop(random.randint(0, len(agents) - 1)) else: return "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36"