juftin / camply

camply, the campsite finder ⛺️ - a tool to find campsites at sold out campgrounds through sites like recreation.gov
https://juftin.com/camply/
MIT License
464 stars 89 forks source link

ReserveCalifornia cancellations are locked #329

Open jeffhammett opened 5 months ago

jeffhammett commented 5 months ago

Describe the bug

When someone cancels a reservation on reservecalifornia, the site does not become immediately available and instead becomes locked. I believe sites unlock at 8am the following day as this is all i have observed, but it may be possible there are other times that they unlock. Regardless, Camply does not account for this and will instead show sites as unavailable instead of becoming available at 8am. The unlock time is included in the json returned by the API and Camply could account for this to let users know sites will become available at the unlock time.

Original Camply Command (with --debug)

camply campsites --campground 757 --start-date 2024-09-06 --end-date 2024-09-08 --nights 2 --provider reservecalifornia --debug

Expected behavior Camply should identify site 33 (see json) as becoming available at 8am on 3/15/2024.

Console Output (with --debug)

[2024-03-14 16:33:37] CAMPLY   camply, the campsite finder  ⛺️                                                                                                                         
[2024-03-14 16:33:37] DEBUG    Setting up camply debugging                                                                                                                            
[2024-03-14 16:33:37] DEBUG    Camply Version: 0.32.2                                                                                                                                 
[2024-03-14 16:33:37] DEBUG    Python Version: 3.12.2                                                                                                                                 
[2024-03-14 16:33:37] DEBUG    Platform: darwin                                                                                                                                       
[2024-03-14 16:33:37] INFO     Using Camply Provider: "ReserveCalifornia"                                                                                                             
[2024-03-14 16:33:37] INFO     2 booking nights selected for search, ranging from 2024-09-06 to 2024-09-07                                                                            
[2024-03-14 16:33:37] INFO     Searching for availabilities with 2 consecutive night stays.                                                                                           
[2024-03-14 16:33:38] INFO     Searching across 1 campgrounds                                                                                                                         
[2024-03-14 16:33:38] INFO         ⛰  Crystal Cove SP Beach Cottages (#634) - �  Beach Cottages (#757)                                                                                
[2024-03-14 16:33:38] INFO     Searching Beach Cottages, Crystal Cove SP Beach Cottages (757) for availability: September, 2024                                                       
[2024-03-14 16:33:38] DEBUG    Starting new HTTPS connection (1): calirdr.usedirect.com:443                                                                                           
[2024-03-14 16:33:38] DEBUG    https://calirdr.usedirect.com:443 "POST /rdr/rdr/search/grid HTTP/1.1" 200 None                                                                        
[2024-03-14 16:33:38] INFO             ❌       0 total sites found in month of September                                                                                             
[2024-03-14 16:33:38] INFO     ❌ ❌ ❌ ❌ 0 Reservable Campsites Matching Search Preferences                                                                                         
[2024-03-14 16:33:38] CAMPLY   Exiting camply �             

Using curl I was able to send a similar POST request as Camply and view the JSON output from the API. Below is a snippet showing the site and the lock parameter for when a site will become available. On 9/6 and 9/7 the site shows that it is not free, but the lock parameter has a date/time identifying when it will become reservable. On 9/8 the lock parameter is null which indicates that it is reserved. Full json output attached.

curl

curl -d '{"FacilityID":"757", "StartDate":"09-06-2024", "EndDate":"09-08-2024"}' -H "Content-Type: application/json" -X POST https://calirdr.usedirect.com/rdr/rdr/search/grid

json output snippet showing site 33 as locked

        "UnitId": 53730,
        "Name": "Premium Cottage (6 ppl) #33",
        "ShortName": "33",
        "RecentPopups": 0,
        "IsAda": false,
        "AllowWebBooking": true,
        "MapInfo": {
          "UnitImage": "California/Units/campercabinelectric",
          "UnitImageVBT": "https://cali-content.usedirect.com/images/California/Units/campercabinelectric.NotAvailable.png",
          "ImageCoordinateX": 0,
          "ImageCoordinateY": 0,
          "ImageWidth": 35,
          "ImageHeight": 35,
          "FontSize": 8,
          "Latitude": 0,
          "Longitude": 0
        },
        "IsWebViewable": true,
        "IsFiltered": false,
        "UnitCategoryId": 1008,
        "SleepingUnitIds": null,
        "UnitTypeGroupId": 30,
        "UnitTypeId": 4449,
        "UseType": 4,
        "VehicleLength": 0,
        "OrderBy": 33,
        "SliceCount": 3,
        "AvailableCount": 0,
        "IsFavourite": false,
        "Slices": {
          "2024-09-06T00:00:00": {
            "Date": "2024-09-06",
            "IsFree": false,
            "IsBlocked": false,
            "IsWalkin": false,
            "ReservationId": 0,
            "Lock": "2024-03-15T08:00:00",
            "MinStay": 1,
            "IsReservationDraw": false
          },
          "2024-09-07T00:00:00": {
            "Date": "2024-09-07",
            "IsFree": false,
            "IsBlocked": false,
            "IsWalkin": false,
            "ReservationId": 0,
            "Lock": "2024-03-15T08:00:00",
            "MinStay": 1,
            "IsReservationDraw": false
          },
          "2024-09-08T00:00:00": {
            "Date": "2024-09-08",
            "IsFree": false,
            "IsBlocked": false,
            "IsWalkin": false,
            "ReservationId": 6141379,
            "Lock": null,
            "MinStay": 1,
            "IsReservationDraw": false
          }
        },
        "OrderByRaw": 4292,
        "StartTime": null,
        "EndTime": null
      },

Full json: output.json

juftin commented 4 months ago

Oh nice - this seems very reasonable to implement. I will follow up here once I have something.