fix: keep shipping_type SHIPPING for individual postage (#785)

This commit is contained in:
Jens
2026-01-24 15:31:22 +01:00
committed by GitHub
parent 08385fa01d
commit 6cc17f869c
2 changed files with 80 additions and 4 deletions

View File

@@ -553,7 +553,7 @@ class AdExtractor(WebScrapingMixin):
# Find all options with the same price to determine the package size
matching_options = [opt for opt in shipping_costs if opt["priceInEuroCent"] == price_in_cent]
if not matching_options:
return "NOT_APPLICABLE", ship_costs, shipping_options
return "SHIPPING", ship_costs, None
# Use the package size of the first matching option
matching_size = matching_options[0]["packageSize"]
@@ -570,11 +570,11 @@ class AdExtractor(WebScrapingMixin):
# Only use the matching option if it's not excluded
matching_option = next((x for x in shipping_costs if x["priceInEuroCent"] == price_in_cent), None)
if not matching_option:
return "NOT_APPLICABLE", ship_costs, shipping_options
return "SHIPPING", ship_costs, None
shipping_option = shipping_option_mapping.get(matching_option["id"])
if not shipping_option or shipping_option in self.config.download.excluded_shipping_options:
return "NOT_APPLICABLE", ship_costs, shipping_options
return "SHIPPING", ship_costs, None
shipping_options = [shipping_option]
except TimeoutError: # no pricing box -> no shipping given