From e6d5a07b08907d891a976c8cad904547efd7e5c0 Mon Sep 17 00:00:00 2001 From: ArtixZ Date: Fri, 13 Mar 2026 20:26:31 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20ReserveCalifornia=20bookin?= =?UTF-8?q?g=20URLs=20to=20use=20new=20path=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ReserveCalifornia's new site uses /park/{rec_area_id}/{facility_id} instead of the old /Web/Default.aspx#!park/{rec_area_id}/{facility_id} hash-fragment format. Add booking_path_hash flag to support both URL styles across UseDirect providers. Closes #392 Made-with: Cursor --- camply/providers/usedirect/usedirect.py | 6 +++++- camply/providers/usedirect/variations.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/camply/providers/usedirect/usedirect.py b/camply/providers/usedirect/usedirect.py index f2b6ff2d..585ee162 100644 --- a/camply/providers/usedirect/usedirect.py +++ b/camply/providers/usedirect/usedirect.py @@ -66,6 +66,7 @@ class UseDirectProvider(BaseProvider, ABC): booking_path_params: bool = True booking_path: str = "Web/Default.aspx" + booking_path_hash: bool = True @property @abstractmethod @@ -449,7 +450,10 @@ def _get_available_campsite( recreation_area = self.usedirect_rec_areas[facility.recreation_area_id] booking_url = f"{self.campground_url}/{self.booking_path}" if self.booking_path_params is True: - booking_url = f"{booking_url}#!park/{recreation_area.recreation_area_id}/{facility_id}" + if self.booking_path_hash: + booking_url = f"{booking_url}#!park/{recreation_area.recreation_area_id}/{facility_id}" + else: + booking_url = f"{booking_url}/{recreation_area.recreation_area_id}/{facility_id}" if unit.UnitCategoryId is None: unit.UnitCategoryId = -1 if unit.UnitTypeGroupId is None: diff --git a/camply/providers/usedirect/variations.py b/camply/providers/usedirect/variations.py index e03f3563..48a39572 100644 --- a/camply/providers/usedirect/variations.py +++ b/camply/providers/usedirect/variations.py @@ -31,6 +31,8 @@ class ReserveCalifornia(UseDirectProvider): campground_url = "https://www.reservecalifornia.com" state_code = "CA" rdr_path = "" + booking_path = "park" + booking_path_hash = False class FloridaStateParks(UseDirectProvider):