ch0chi / casa-bonita-booking-finder

A bot that checks if any new booking dates have been added at Casa Bonita
MIT License
6 stars 0 forks source link

Breaking API Changes #1

Open juftin opened 2 months ago

juftin commented 2 months ago

This is an amazing project - I was about to build my own and then stumbled upon this. Really nice work!

/api/v1/validate-booking-code returned the following error for me:

{ error: "I'm a little teapot" }

It also looks like their URL format changed so getBookingCode didn't work right either.

Unfortunately it looks like the Casa Bonita API has changed and they seem to be using a number of ways to prevent scrapers - I played around with new endpoints like /api/v2/search and got 302s / binary response content.

I'm not sure how much further I'll keep digging, but if I find anything helpful I'll do my best to follow up with a PR.

ch0chi commented 1 month ago

@juftin Yeah, I've been meaning to add a deprecation notice to the project. Unfortunately, it seems they updated their api to patch the method this bot uses to fetch booking dates. The updated api utilizes a cookie based queue system, which is difficult to bypass. I tried to find a backdoor, but after a couple of hours it just wasn't worth the effort. I've been been lucky to have been able to visit multiple times after they reopened, so it's difficult to find the motivation to keep working on it.

It's probably possible to use something like puppeteer or Beautiful Soup to scrape the booking url page for dates.

Anyway, thanks for bringing this up! Let me know if you end up finding another method. I may work on this in the future if I'm able to get someone's booking url.