From 0a0a1920a6ab03d5a2767c2b6c1eeec5df17a04a Mon Sep 17 00:00:00 2001 From: Max Guppy Date: Thu, 5 Dec 2024 09:38:49 +1300 Subject: [PATCH] advent: Add user-agent header to leaderboard requests --- uqcsbot/advent.py | 1 + 1 file changed, 1 insertion(+) diff --git a/uqcsbot/advent.py b/uqcsbot/advent.py index 30658f8..00c466a 100644 --- a/uqcsbot/advent.py +++ b/uqcsbot/advent.py @@ -356,6 +356,7 @@ def _get_leaderboard_json(self, year: int, code: int) -> Json: response = requests.get( LEADERBOARD_URL.format(year=year, code=code), cookies={"session": self.session_id}, + headers={"user-agent": "github.com/UQComputingSociety/uqcsbot-discord"}, allow_redirects=False, # Will redirct to home page if session token is out of date ) except RequestException as exception: