jdholtz / auto-southwest-check-in

A Python script that automatically checks in to your Southwest flight 24 hours beforehand.
GNU General Public License v3.0
440 stars 84 forks source link

Proxy Capability? #109

Closed zerkz closed 1 year ago

zerkz commented 1 year ago

Description

Could probably pair the docker image with something like https://github.com/qdm12/gluetun/wiki/Connect-a-container-to-gluetun.

After running auto checkin for 2 flights I was IP banned by Southwest 😁 . I had my docker containers with restart:unless-stopped though so I figure that was the problem. I will report back with a working solution if I get something going!

What alternatives have you considered?

No response

jdholtz commented 1 year ago

I had my docker containers with restart:unless-stopped

Depending on the script’s version you had running and/or your configuration, that would restart the container after it checks in. Therefore, it would continuously ping Southwest’s API (by constantly checking in) which would make sense as to why the IP ban happened (if that is how it went).

I’m interested if you find a solution with the proxy. That would be a definite solution to these types of problems.

zerkz commented 1 year ago

Yeah I made a mistake with that -- my issue was that my server hosting the docker container restarted, and the container did not start on host boot, hence my desire for `restart: unless-stopped" to fix that.

I wonder if there's a way we can record the check-in completion to a persistent file that lives beyond container restarts to prevent attempting to check in once it's completed.Maybe i'll take a stab at a PR.

jdholtz commented 1 year ago

my issue was that my server hosting the docker container restarted, and the container did not start on host boot

With the restart policy on-failure, containers should still start on boot automatically. You can test this by restarting the Docker daemon while a container is running and it will start again once the daemon starts.

I wonder if there's a way we can record the check-in completion to a persistent file that lives beyond container restarts to prevent attempting to check in once it's completed

In account mode, the script runs indefinitely so this will never happen (unless retrieval_interval is 0). Also, I refactored flight scheduling (currently in the develop branch) so the script won't exit until reservations are no longer valid, meaning check-ins will only happen once (again, unless retrieval_interval is 0).

This means that, when the script exits, it will not check in to the same flights again once it restarts. Therefore, I don't think an insurance policy like this is necessary (plus the restart policy is documented so this would only happen if the user did not fully read the README -- although I can make it say 'required' instead of 'recommended').

zerkz commented 1 year ago

ahh thank you for the recommendation, I will try on-failure.