Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot attemping to snipe over and over (again) #120

Open
crookedbans opened this issue May 12, 2023 · 34 comments · Fixed by #122
Open

Bot attemping to snipe over and over (again) #120

crookedbans opened this issue May 12, 2023 · 34 comments · Fixed by #122

Comments

@crookedbans
Copy link

After implementing changes from #104, still seeing it trying to snipe over and over.

Initially, it was working for a couple weeks after making those changes, but seeing the issue again today

@vuids
Copy link

vuids commented May 12, 2023

Was just going to open this issue as well, seems to be an issue with the bot. It grabs book token and then throws Missed the shot! for available slots. Started seeing it earlier this week and have not seen a simple fix yet. @Alkaar

@Alkaar Alkaar linked a pull request May 13, 2023 that will close this issue
1 task
@Alkaar
Copy link
Owner

Alkaar commented May 13, 2023

I just pushed a fix 👉 #122. Seems like the Referer header is now required as well.

@vuids
Copy link

vuids commented May 13, 2023

Awesome thank you!

@zenset
Copy link

zenset commented May 19, 2023

Did this fix it for everyone? I am still encountering the same issue. Thanks!

@crookedbans
Copy link
Author

Seeing this issue again this morning as well

@jdeitelzweig
Copy link

Same here

@vuids
Copy link

vuids commented May 22, 2023

@Alkaar might be the same issue happening, just tested it out and looping again.

@seanmcquade20
Copy link

Also seeing this issue. The bot loops on trying to book an available reservation and then eventually stops. @Alkaar any possible fix for this?

@btbeal
Copy link

btbeal commented May 25, 2023

I think Resy may have made their API private? I have my own separate workflow for this but that is also down (getting unauthorized access responses from GET requests).

@deejaymodish
Copy link

how often would resyKeys.auth-token change? the original token I had since I deployed only does this now:
[INFO ] 2023-05-30 12:46:58.046-05:00 ResyBookingWorkflow:18 - Taking the shot... [INFO ] 2023-05-30 12:46:58.050-05:00 ResyBookingWorkflow:19 - (҂‾ ▵‾)︻デ═一 (˚▽˚’!)/ [INFO ] 2023-05-30 12:46:58.052-05:00 ResyBookingWorkflow:20 - Attempting to snipe reservation [INFO ] 2023-05-30 12:47:08.066-05:00 ResyClient:176 - Missed the shot! [INFO ] 2023-05-30 12:47:08.067-05:00 ResyClient:177 - ┻━┻ ︵ \(°□°)/ ︵ ┻━┻ [INFO ] 2023-05-30 12:47:08.069-05:00 ResyClient:178 - Could not find any available reservations [INFO ] 2023-05-30 12:47:08.070-05:00 ResyBookingBot$:53 - Shutting down Resy Booking Bot

but i found what looks to be a different auth-token, and when i use that, i get the loop with the book token before the bot shuts down.

@Alkaar
Copy link
Owner

Alkaar commented Jun 9, 2023

Hey, apologies for not replying back on this. I had some IRL things going on that prevented me from looking into this. My assumption is that it's again related to the headers. I'll see if can get this bot working again. Of course, this being open source, open to anyone else contributing as well.

@Alkaar
Copy link
Owner

Alkaar commented Jun 9, 2023

So I figured out the issue. The user-agent header is now required. This is a weird one because all user-agent does is tell the website what browser made the request. Either they are trying to understand what browsers their users are using or they are trying to stop bots from getting through. I could hard code it but I'd like to make it a bit smarter than that so I'll need to think on it a little.

The get requests look fine for me. Some people have mentioned that additional headers are needed for get requests. If someone can share an example where this is needed, I can use that for my testing and make the necessary changes as well.

@herrrareporterhouse326
Copy link

herrrareporterhouse326 commented Jun 9, 2023

Alkaar I don't believe this is the case - can you please re-confirm you're able to make the reservation all the way through the end (POST) and not just the GETs? I'm still seeing this error out, even with the user-agent supplied as the current Chrome value.

@Alkaar
Copy link
Owner

Alkaar commented Jun 9, 2023

Just retested and double-checked that yes, user-agent is the only thing I changed. What are you passing as user-agent on your end @herrrareporterhouse326?

@herrrareporterhouse326
Copy link

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

@herrrareporterhouse326
Copy link

Alkaar I've tried other user-agent strings as well, they're failing with Internal Server Error too. What string did you successfully use? Pardon me but I think there's more to this than just the user-agent.

@Alkaar
Copy link
Owner

Alkaar commented Jun 10, 2023

I have the exact same user agent. I'm working off master. Below is the diff of my change.

Diff

The only other difference we could have is the resyConfig.conf file. I could try your restaurant too. If that doesn't work then you should perhaps double check that your environment is up to date as well. You should be using release version 3.1.2.

@herrrareporterhouse326
Copy link

Okay yes, confirmed it was a blooper on my part. Looks good!

@resygoat
Copy link

@Alkaar I don't know if im stupid, but I did this fix, and it still won't work for me. I don't really know code, I was wondering if you could help me.

@resygoat
Copy link

@Alkaar I don't know if im stupid, but I did this fix, and it still won't work for me. I don't really know code, I was wondering if you could help me.

I keep trying and trying but it never works for me, I really want this to work

@resygoat
Copy link

Is there anyway u can release a new updated version, because I can't seem to get it right everytime @Alkaar

@eftehassanpp
Copy link

everyone from your terminal just run "git clone https://github.com/Alkaar/resy-booking-bot.git"
this command will download the lates and it will solve your issues

@Philmod
Copy link

Philmod commented Jun 10, 2023

I'm also having a hard time make it work, I keep having this error in a loop:

[INFO ] 2023-06-10 08:07:07.992-04:00 ResyBookingWorkflow:18 - Taking the shot...
[INFO ] 2023-06-10 08:07:07.992-04:00 ResyBookingWorkflow:19 - (҂‾ ▵‾)︻デ═一 (˚▽˚’!)/
[INFO ] 2023-06-10 08:07:07.992-04:00 ResyBookingWorkflow:20 - Attempting to snipe reservation
[INFO ] 2023-06-10 08:07:08.072-04:00 ResyClient:197 - Config Id: rgs://resy/53739/1450999/2/2023-06-21/2023-06-21/18:00:00/2/Dining Room
[INFO ] 2023-06-10 08:07:08.108-04:00 ResyClient:97 - Missed the shot!
[INFO ] 2023-06-10 08:07:08.108-04:00 ResyClient:98 - ┻━┻ ︵ \(°□°)/ ︵ ┻━┻
[INFO ] 2023-06-10 08:07:08.108-04:00 ResyClient:99 - Unknown error occurred

I'm also seeing that the script keeps trying the same time slot which is the last one of the res-time-types (see below). I don't see logs about the previous times.

I'm using the code from the master branch, with these diff (excluding the api-key and auth-token):
Screenshot 2023-06-10 at 08 15 38

Is there any way to show more logs with more detailed errors?

@seanmcquade20
Copy link

seanmcquade20 commented Jun 10, 2023

I'm using the code from the master branch, with these diff (excluding the api-key and auth-token): Screenshot 2023-06-10 at 08 15 38

Is there any way to show more logs with more detailed errors?

The User-Agent header should be updated in the ResyApi.scala file. It should look like this:

ws.url(url)
      .withHttpHeaders(
        createHeaders(resyKeys) ++ Seq(
          "Content-Type" -> "application/x-www-form-urlencoded",
          "Origin"       -> "https://widgets.resy.com",
          "Referer"      -> "https://widgets.resy.com/",
          "User-Agent"   -> "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
        ): _*
      )
      .post(post)
      .map(_.body)(system.dispatcher)
  }

@Philmod
Copy link

Philmod commented Jun 10, 2023

@seanmcquade20 Thanks, that's mostly what I had in my diff. I tried copying exactly your user-agent, but still the same error.

@seanmcquade20
Copy link

@Philmod all appears to be working correctly for me. If you turn the status in the log4j config to debug you'll be able to get more info. It does spit out a lot of information though.

@crookedbans
Copy link
Author

As the original poster here, HUGE thanks for @Alkaar for once again maintaining this. Just in time, this morning, I was able to get a birthday res for my girlfriend which I would have otherwise had 0 chance at.

Working totally fine, cheers to this legend Alkaar

@Philmod
Copy link

Philmod commented Jun 10, 2023

I found the issue thanks to the logs: my account didn't have a credit card in file but the reservation required one.

Thanks @seanmcquade20 & @Alkaar!

@deejaymodish
Copy link

Adding User-agent definitely fixed it

@jaipalsilla
Copy link

user agent fix worked for me as well

@Frozentreefrog
Copy link

Frozentreefrog commented Jun 16, 2023

hey guys, can we always set the user-agent exactly to:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

even if we have a Mac or a different device? The bot still is suddenly broken for me, even when i use the user-agent header

@sb226tea
Copy link

Broken again..?

@Alkaar
Copy link
Owner

Alkaar commented Jun 17, 2023

It worked for me this morning so not broken. Your machine type doesn't matter. However, I suggest you use the user-agent from your browser though. I have a feeling they are clamping down on bots and it will be a red flag if they see your browser has suddenly changed to something you don't normally use.

@kellyk0
Copy link

kellyk0 commented Jul 14, 2023

hi! i applied the user-agent fix but it still is missing the shot with book token

injust added a commit to injust/resy-booking-bot that referenced this issue Aug 21, 2023
injust added a commit to injust/resy-booking-bot that referenced this issue Aug 21, 2023
injust added a commit to injust/resy-booking-bot that referenced this issue Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.