try cookies

This commit is contained in:
2025-12-07 18:57:34 +01:00
parent 7094801549
commit df1a60034c
2 changed files with 24 additions and 2 deletions

View File

@@ -79,9 +79,23 @@ if match:
else: else:
wh_masked_url = "[Invalid webhook URL]" wh_masked_url = "[Invalid webhook URL]"
# HTTP headers - minimal # HTTP headers - Firefox working set
HEADERS = { HEADERS = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language": "fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3",
"Accept-Encoding": "gzip, deflate, br, zstd",
"Cache-Control": "no-cache",
"Pragma": "no-cache",
"Sec-GPC": "1",
"Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1",
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "none",
"Sec-Fetch-User": "?1",
"Priority": "u=0, i",
"TE": "trailers"
} }
# Load country setting and localization config # Load country setting and localization config

View File

@@ -22,6 +22,14 @@ first_run_dict = {name: True for name in PRODUCT_NAMES}
def check_rtx_50_founders(): def check_rtx_50_founders():
global last_sku_dict, global_stock_status_dict, first_run_dict global last_sku_dict, global_stock_status_dict, first_run_dict
# First get Akamai cookie by visiting main site
try:
logging.info("Getting Akamai protection cookie...")
session.get("https://marketplace.nvidia.com/fr-fr/consumer/graphics-cards/", timeout=10)
time.sleep(1) # Let the session establish
except Exception as e:
logging.warning(f"Failed to get initial cookie: {e}")
# Fetching nvidia API data # Fetching nvidia API data
try: try:
sku_url = API_URL_SKU sku_url = API_URL_SKU