big changes, sorry

This commit is contained in:
2025-05-27 12:22:52 +03:00
parent bb12fe5ca7
commit bcee61a817
7 changed files with 371 additions and 98 deletions

View File

@@ -357,7 +357,8 @@ def extract_product_info(
"shop": shop_delivery,
"home": home_delivery,
},
"in_stock": shop_delivery in ("FOR_TOMORROW", "IMMEDIATE") or home_delivery in ("FOR_TOMORROW", "IMMEDIATE"),
# "in_stock": shop_delivery in ("FOR_TOMORROW", "IMMEDIATE") or home_delivery in ("FOR_TOMORROW", "IMMEDIATE"),
"in_stock": all(code not in ("UNAVAILABLE", "TEMPORARILY_UNAVAILABLE", None) for code in [shop_delivery, home_delivery])
}
@@ -459,7 +460,8 @@ def fetch_products(
driver, # Передаем driver в clean_description
filtered_product["plu"],
)
all_products.append(filtered_product)
if filtered_product["prices"]["mainPrice"] >= 300:
all_products.append(filtered_product)
current_product += 1
if status is not None: