mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 18:41:50 +01:00
fix: keep shipping_type SHIPPING for individual postage (#785)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user