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

GoingToCamp fails for WA #328

Closed javagenki closed 3 months ago

javagenki commented 5 months ago

Describe the bug

I cannot find a campground within WA due to an error when querying GoingToCamp for the

Original Camply Command (with --debug)

pi@camply:~/camply $ camply recreation-areas --provider "GoingToCamp"
[2024-03-11 16:53:16] CAMPLY   camply, the campsite finder ⛺️
[2024-03-11 16:53:16] INFO     Using Camply Provider: "GoingToCamp"
[2024-03-11 16:53:16] INFO     ⛰  Algonquin Highlands, Ontario, CA (#8)
[2024-03-11 16:53:16] INFO     ⛰  BC Parks, British Columbia, CA (#12)
[2024-03-11 16:53:16] INFO     ⛰  Gatineau Park, Ottawa-Gatineau, Ontario-Quebec, CA (#10)
[2024-03-11 16:53:16] INFO     ⛰  Long Point Region, Ontario, CA (#1)
[2024-03-11 16:53:16] INFO     ⛰  Maitland Valley, Ontario, CA (#4)
[2024-03-11 16:53:16] INFO     ⛰  Manitoba Parks, Manitoba, CA (#15)
[2024-03-11 16:53:16] INFO     ⛰  Maryland State Parks, Maryland, USA (#9)
[2024-03-11 16:53:16] INFO     ⛰  Michigan State Parks, Michigan, USA (#17)
[2024-03-11 16:53:16] INFO     ⛰  New Brunswick Provincial Parks, New Brunswick, CA (#16)
[2024-03-11 16:53:16] INFO     ⛰  Newfoundland & Labrador Provincial Parks, Newfoundland and Labrador, CA (#11)
[2024-03-11 16:53:16] INFO     ⛰  Nova Scotia Parks, Nova Scotia, CA (#13)
[2024-03-11 16:53:16] INFO     ⛰  Parks Canada, CA (#14)
[2024-03-11 16:53:16] INFO     ⛰  Saugeen Valley, Ontario, CA (#5)
[2024-03-11 16:53:16] INFO     ⛰  St. Clair Region, Ontario, CA (#2)
[2024-03-11 16:53:16] INFO     ⛰  Tacoma Power Parks, Washington, USA (#6)
[2024-03-11 16:53:16] INFO     ⛰  Washington State Parks, Washington, USA (#3)
[2024-03-11 16:53:16] INFO     ⛰  Wisconsin State Parks, Wisconsin, USA (#7)

pi@camply:~/camply $ camply campgrounds --rec-area 3 --provider goingtocamp --debug
[2024-03-11 17:49:13] CAMPLY   camply, the campsite finder ⛺️
[2024-03-11 17:49:13] INFO     Using Camply Provider: "GoingToCamp"
[2024-03-11 17:49:13] DEBUG    Setting up camply debugging
[2024-03-11 17:49:13] DEBUG    Camply Version: 0.32.2
[2024-03-11 17:49:13] DEBUG    Python Version: 3.11.2
[2024-03-11 17:49:13] DEBUG    Platform: linux
[2024-03-11 17:49:13] INFO     Retrieving Facility Information for Recreation Area ID: `3`.
[2024-03-11 17:49:13] DEBUG    Starting new HTTPS connection (1): washington.goingtocamp.com:443
[2024-03-11 17:49:14] DEBUG    https://washington.goingtocamp.com:443 "GET /api/resourceLocation HTTP/1.1" 403 None
[2024-03-11 17:49:14] DEBUG    Encoding detection: ascii is most likely the one.
[2024-03-11 17:49:14] ERROR    Receiving bad data from GoingToCamp API: status_code: 403: <html><head><title>goingtocamp.com</title><style>#cmsg{animation: A
                               1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS
                               and disable any ad blocker</p><script data-cfasync="false">var
                               dd={'rt':'c','cid':'AHrlqAAAAAMA0fLp2EUd9F4AMi_9Vg==','hsh':'568CC9CF98AB4BEB49884E066FEF42','t':'fe','s':35226,'e':'2e16353a403bc55af
                               b319ae386e004800c0bedc543abd65a0764d1a140b2b826','host':'geo.captcha-delivery.com'}</script><script data-cfasync="false"
                               src="https://ct.captcha-delivery.com/c.js"></script></body></html>

[2024-03-11 17:49:14] CAMPLY   Exiting camply 👋

Expected behavior This works with the other rec-areas I have tried.

pi@camply:~/camply $  camply campgrounds --rec-area 1 --provider goingtocamp
[2024-03-11 17:45:28] CAMPLY   camply, the campsite finder ⛺️
[2024-03-11 17:45:28] INFO     Using Camply Provider: "GoingToCamp"
[2024-03-11 17:45:28] INFO     Retrieving Facility Information for Recreation Area ID: `1`.
[2024-03-11 17:45:29] INFO     5 Matching Campgrounds Found
[2024-03-11 17:45:29] INFO     ⛰  Long Point Region, Ontario (#1) - 🏕  Backus Heritage Conservation Area (#-2147483648)
[2024-03-11 17:45:29] INFO     ⛰  Long Point Region, Ontario (#1) - 🏕  Deer Creek Conservation Area (#-2147483647)
[2024-03-11 17:45:29] INFO     ⛰  Long Point Region, Ontario (#1) - 🏕  Haldimand Conservation Area (#-2147483646)
[2024-03-11 17:45:29] INFO     ⛰  Long Point Region, Ontario (#1) - 🏕  Norfolk Conservation Area (#-2147483644)
[2024-03-11 17:45:29] INFO     ⛰  Long Point Region, Ontario (#1) - 🏕  Waterford North Conservation Area (#-2147483643)
[2024-03-11 17:45:29] CAMPLY   Exiting camply 👋
juftin commented 5 months ago

Dang, that looks like https://washington.goingtocamp.com putting up Captcha in front of their API 😥

That means they don't want tools like Camply playing around in their data.

javagenki commented 5 months ago

Oh, no! What are they thinking??? That's a lousy thing to do.

javagenki commented 5 months ago

I don't suppose there is any way around this is there?

juftin commented 3 months ago

Closed by #340

Huge thanks to @regaw-leinad!