pyro2927 / SouthwestCheckin

🛫 Python script to checkin to a Southwest Flight 🛬
GNU General Public License v3.0
424 stars 129 forks source link

Not handling 429's gracefully #70

Open jasonwbarnett opened 3 years ago

jasonwbarnett commented 3 years ago

This may not be directly applicable since I only ran into the error condition after I changed the code in a fork (lowered retry sleep), but it still may make sense to add exception handling for the situation where Southwest rate limits requests and returns a 429. Thinking that adding an additional sleep (i.e. 5 seconds) may make sense.

Response

HTTP/1.1 429 Too Many Requests

Body

{
  "code": 429999999,
  "message": "Error.",
  "messageKey": "ERROR",
  "httpStatusCode": "BAD_REQUEST",
  "requestId": "",
  "infoList": []
}

For reference: https://datatracker.ietf.org/doc/html/rfc6585#section-4

bjhiltbrand commented 8 months ago

I used to use this script, and it worked great when I used it. But recently, I have been using this docker container: https://github.com/jdholtz/auto-southwest-check-in It was easier to setup and cleaner and has been running like a champ. Take a look over there.

3052 commented 8 months ago

@bjhiltbrand that repo uses a browser:

https://github.com/jdholtz/auto-southwest-check-in/blob/master/requirements.txt#L4

I am looking for non browser solution if possible