From bf79d3c9773f56f177c22222a2907a743f67cde2 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sun, 22 Jun 2025 13:05:53 +0000 Subject: [PATCH] convert district at the last moment - when we send the query --- crawler/rec/query.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crawler/rec/query.py b/crawler/rec/query.py index ea49d63..884ef62 100644 --- a/crawler/rec/query.py +++ b/crawler/rec/query.py @@ -5,6 +5,7 @@ import enum from typing import Any import aiohttp from models.listing import FurnishType, ListingType, QueryParameters +from rec import districts from tenacity import retry, wait_random @@ -52,7 +53,7 @@ async def listing_query( radius: float, min_price: int, max_price: int, - location_id: str, # = "STATION^5168", # kings cross station + district: str, # = "STATION^5168", # kings cross station mustNewHome: bool = False, max_days_since_added: int = 30, property_type: list[PropertyType] = [], @@ -60,7 +61,7 @@ async def listing_query( furnish_types: list[FurnishType] = [], ) -> dict[str, Any]: params: dict[str, str] = { - "locationIdentifier": location_id, + "locationIdentifier": districts.get_districts()[district], "channel": str(channel).upper(), "page": str(page), "numberOfPropertiesPerPage": str(page_size),