Skip to content

Commit

Permalink
FIX: use custom user agent when requesting event schedule data from GH (
Browse files Browse the repository at this point in the history
  • Loading branch information
theOehrly committed Nov 17, 2024
1 parent 911d29c commit 0eff744
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fastf1/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@

import fastf1._api
import fastf1.ergast
from fastf1 import __version_short__
from fastf1.core import Session
from fastf1.internals.fuzzy import fuzzy_matcher
from fastf1.internals.pandas_base import (
Expand Down Expand Up @@ -235,6 +236,7 @@

_SCHEDULE_BASE_URL = "https://raw.githubusercontent.com/" \
"theOehrly/f1schedule/master/"
_HEADERS = {'User-Agent': f'FastF1/{__version_short__}'}


def get_session(
Expand Down Expand Up @@ -580,7 +582,8 @@ def get_events_remaining(
_logger)
def _get_schedule_ff1(year):
response = Cache.requests_get(
_SCHEDULE_BASE_URL + f"schedule_{year}.json"
_SCHEDULE_BASE_URL + f"schedule_{year}.json",
headers=_HEADERS
)

data = dict()
Expand Down

0 comments on commit 0eff744

Please sign in to comment.