-
-
Notifications
You must be signed in to change notification settings - Fork 95
feat: Implement Datadome cookie fetching to handle 403 errors #656
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
base: main
Are you sure you want to change the base?
Conversation
Adds a mechanism to proactively fetch a new Datadome cookie when a 403 Forbidden response is received from the TGTG API. This new method calls the Datadome SDK endpoint with a simulated device fingerprint to obtain a valid cookie, allowing the original request to be retried successfully.
|
I tried your code. The code itself seems to run fine but I still get a 403 error. [2025-11-26 15:19:22][tgtg][main.py:_print_welcome_message:289][INFO] |
Refactor error handling and cookie management in tgtg_client.py. Simplify exception handling and improve cookie setting logic.
|
Updated the code, try now? |
|
Still the same error. [2025-11-26 16:02:52][tgtg][main.py:_print_welcome_message:289][INFO] |
|
@sonar98 Are you overriding the app version? |
|
Hi @LeagueOfPoro. Thank you for your contribution. I will have a look at your contribution later and give you a more detailed review. |
Yes, I tried it with 24.11.0 |
|
I tried it too but getting similar errors. |
|
I added some logging to see what is going on. self.datadome_cookie -> shows a datadome_cookie, so this works. I logged the variables in this response: request_url -> https://apptoogoodtogo.com/api/auth/v5/authByEmail |
Adds a mechanism to proactively fetch a new Datadome cookie when a 403 Forbidden response is received from the TGTG API. This new method calls the Datadome SDK endpoint with a simulated device fingerprint to obtain a valid cookie, allowing the original request to be retried successfully.
Based on the following blog post: https://www.cereal-automation.com/blog/datadome-tgtg-api
Fixes #650, #631, #622, and related