Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unable to Fetch Pre-Season Testing Data (403 & 404 Errors) #688

Open
foxyskippy opened this issue Feb 26, 2025 · 12 comments
Open

[BUG] Unable to Fetch Pre-Season Testing Data (403 & 404 Errors) #688

foxyskippy opened this issue Feb 26, 2025 · 12 comments

Comments

@foxyskippy
Copy link

foxyskippy commented Feb 26, 2025

Describe the issue:

I'm trying to fetch Pre-Season Testing data for 2025 using fastf1.get_testing_session(), but the request fails due to 403 Forbidden and 404 Not Found errors when attempting to retrieve session data from livetiming.formula1.com and the FastF1 mirror.

Reproduce the code example:

import fastf1 as ff1
import logging

# Debug logging inschakelen
logging.basicConfig(level=logging.DEBUG)

### 💾 CACHE MODUS
ff1.Cache.enable_cache(r'F1 Telemetry')

### 📡 FASTF1 SESSION - TESTING DATA
session = ff1.get_testing_session(2025, 1, 1)
session.load()
preseasonlaps = session.laps

df = pd.DataFrame(preseasonlaps)
print(df)

Error message:

Steps to Reproduce
Enable FastF1 caching:

import fastf1
fastf1.Cache.enable_cache('F1 Telemetry')
session = fastf1.get_testing_session(2025, 1, 1)
session.load()

Observed Behavior
FastF1 tries to retrieve data from:
https://livetiming.formula1.com/static/2025/2025-02-28_Pre-Season_Testing/2025-02-26_Practice_1/SessionInfo.jsonStream
but receives 403 Forbidden.
FastF1 then attempts the mirror:
https://livetiming-mirror.fastf1.dev/static/2025/2025-02-28_Pre-Season_Testing/2025-02-26_Practice_1/SessionInfo.jsonStream
which returns 404 Not Found.
Similar errors occur for driver data, timing data, telemetry, and weather information.
@ChemiF1
Copy link

ChemiF1 commented Feb 26, 2025

There is no replay available at the F1 Oficial App. Has it any relation to the problem?

@Yoshi234
Copy link

I ran into the same issue while trying to fetch the testing data.

@RabbiNash
Copy link

Facing the same issue. If you get a fix please do help.

@theOehrly
Copy link
Owner

Thanks for the report. At this stage I cannot tell what is going on. Though, I have to say that there hasn't always been replay data available in recent years. Therefore, the data might simply be missing.
In any case, I probably won't have time to look at this before friday.

@pesaventofilippo
Copy link
Contributor

@theOehrly I think they just changed the URL a bit:
From FastF1 3.4.4:

import fastf1
session = fastf1.get_testing_session(2025, 1, 1)
print(session.api_path) # '/static/2025/2025-02-28_Pre-Season_Testing/2025-02-26_Practice_1/'

But from livetiming.formula1.com:
"Path": "2025/2025-02-28_Pre-Season_Testing/2025-02-26_Day_1/"

Specifically, it's "Day_1" instead of the expected "Practice_1"

@theOehrly
Copy link
Owner

@pesaventofilippo i've got a few minutes right now... hacky fix incoming

@foxyskippy
Copy link
Author

@theOehrly I think they just changed the URL a bit: From FastF1 3.4.4:

import fastf1
session = fastf1.get_testing_session(2025, 1, 1)
print(session.api_path) # '/static/2025/2025-02-28_Pre-Season_Testing/2025-02-26_Practice_1/'

But from livetiming.formula1.com: "Path": "2025/2025-02-28_Pre-Season_Testing/2025-02-26_Day_1/"

Specifically, it's "Day_1" instead of the expected "Practice_1"

Yes @pesaventofilippo you are correct

@theOehrly
Copy link
Owner

Should be working now. Please upgrade to v3.4.5. I hope it keeps working for the next two days as well, and that I didn't mess anything up.

@patadeganzo
Copy link

Should be working now. Please upgrade to v3.4.5. I hope it keeps working for the next two days as well, and that I didn't mess anything up.

I upgraded the FastF1 library to version 3.4.5, but I’m still getting the same error. I’ve tried using "Pre-Season Testing" and "FP1" as inputs, as well as "Day_1" and "Practice_1," but the error keeps appearing. Any ideas on what might be causing this?

@pesaventofilippo
Copy link
Contributor

@patadeganzo Are you using get_testing_session() instead of the normal get_session()?
For me it works now, using version 3.4.5 and fastf1.get_testing_session(2025, 1, 1)

@patadeganzo
Copy link

@patadeganzo Are you using get_testing_session() instead of the normal get_session()? For me it works now, using version 3.4.5 and fastf1.get_testing_session(2025, 1, 1)

It ran smoothly without any issues. It’s not the prettiest solution, but it gets the job done. Appreciate it, mate!

@Yoshi234
Copy link

@theOehrly thanks for the fix. It works now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants