diff --git a/daftlistings/daft.py b/daftlistings/daft.py index 700318e..d8c433e 100644 --- a/daftlistings/daft.py +++ b/daftlistings/daft.py @@ -28,6 +28,8 @@ def __init__(self): "Content-Type": "application/json", "brand": "daft", "platform": "web", + "Origin": "https://www.daft.ie", + "Referer": "https://www.daft.ie/", } def set_headers(self, headers: Dict[str, str]): diff --git a/examples/map_visualization.py b/examples/map_visualization.py index fa1c00b..1c650cb 100644 --- a/examples/map_visualization.py +++ b/examples/map_visualization.py @@ -8,7 +8,6 @@ MapVisualization, ) - daft = Daft() daft.set_location(Location.DUBLIN) daft.set_search_type(SearchType.RESIDENTIAL_RENT) diff --git a/tests/test_daft_search.py b/tests/test_daft_search.py index 1332675..0c407f3 100644 --- a/tests/test_daft_search.py +++ b/tests/test_daft_search.py @@ -44,6 +44,8 @@ def test_search_basic(self, mock_post): "Content-Type": "application/json", "brand": "daft", "platform": "web", + "Referer": "https://www.daft.ie/", + "Origin": "https://www.daft.ie", } daft = Daft() @@ -59,6 +61,8 @@ def test_custom_user_agent(self, mock_post): "Content-Type": "application/json", "brand": "daft", "platform": "web", + "Referer": "https://www.daft.ie/", + "Origin": "https://www.daft.ie", } daft = Daft() @@ -99,6 +103,8 @@ def test_search_properties_for_sale(self, mock_post): "Content-Type": "application/json", "brand": "daft", "platform": "web", + "Referer": "https://www.daft.ie/", + "Origin": "https://www.daft.ie", } daft = Daft() @@ -151,6 +157,8 @@ def test_search_properties_for_rent(self, mock_post): "Content-Type": "application/json", "brand": "daft", "platform": "web", + "Referer": "https://www.daft.ie/", + "Origin": "https://www.daft.ie", } daft = Daft() @@ -191,6 +199,8 @@ def test_search_multiple_areas(self, mock_post): "Content-Type": "application/json", "brand": "daft", "platform": "web", + "Referer": "https://www.daft.ie/", + "Origin": "https://www.daft.ie", } daft = Daft() @@ -220,6 +230,8 @@ def test_shared_listings(self, mock_post): "Content-Type": "application/json", "brand": "daft", "platform": "web", + "Referer": "https://www.daft.ie/", + "Origin": "https://www.daft.ie", } daft = Daft()