We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0177384 + f4aa79a commit 2db960cCopy full SHA for 2db960c
src/main.py
@@ -24,6 +24,8 @@
24
PLAYER_STR_FORMAT = '{rank:2}) {name:{name_pad}} ({points:{points_pad}}) {stars:{stars_pad}}* ({star_time})\n'
25
URL_STR_FORMAT = 'https://adventofcode.com/{year}/leaderboard/private/view/{leaderboard_id}.json'
26
27
+USER_AGENT = 'github.com/CSSUoB/advent-of-code-bot by [email protected]'
28
+
29
players_cache = {}
30
31
@@ -43,6 +45,7 @@ def get_players(year: int = CURRENT_YEAR):
43
45
44
46
req = urllib.request.Request(url)
47
req.add_header('Cookie', 'session=' + COOKIE)
48
+ req.add_header('User-Agent', USER_AGENT)
49
50
try:
51
page = urllib.request.urlopen(req).read()
0 commit comments