Closed dmytrokoren closed 5 months ago
Thanks for the PR! Sorry I haven't been able to address this for a few days (I've been pretty busy), but my schedule is clearing up a bit this weekend.
I've tested this on Docker and an Ubuntu headless server and it's working very well. I still occasionally do get 403s but this is definitely a huge improvement.
@jdholtz no problem. I'm breaking my head here trying all different ways. I'm still working on this and testing in multiple machines, Mac OS, amd64 and arm64. I hopefully will have something stable but there will still be few 429 and 403 will slip some way or another.
SW has put a huge limit on requests and it's even happening in native application if you do lots of login and log out.
I am also still reaching 429s when logging in. This PR doesn't appear to handle errors for logging in, only using reservations, but it would be nice to get both of those working to a similar level.
SeleniumBase's undetected mode works best with Google Chrome. If it can go undetected using Chrome, it will probably be best switch to Chrome (currently Chromium is used). Here's the Docker image for that
FROM python:3.12-slim
WORKDIR /app
# Define so the script knows not to download a new driver version, as
# this Docker image already downloads a compatible chromedriver
ENV AUTO_SOUTHWEST_CHECK_IN_DOCKER 1
RUN apt-get update && apt-get upgrade
RUN apt-get install -y wget
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install -y ./google-chrome-stable_current_amd64.deb
COPY requirements.txt requirements.txt
RUN pip3 install --upgrade pip && pip3 install --no-cache-dir -r requirements.txt
COPY . .
ENTRYPOINT ["python3", "-u", "southwest.py"]
SW has put a huge limit on requests and it's even happening in native application if you do lots of login and log out.
Yeah, this is a pretty frustrating issue and it seems like the fix will need to be a bit more complicated (adding delays for multiple accounts/reservations, etc.). I have actually gotten a few 429's while logging into the website from my phone too so there system definitely does have false positives right now.
I am also still reaching 429s when logging in. This PR doesn't appear to handle errors for logging in, only using reservations, but it would be nice to get both of those working to a similar level.
SeleniumBase's undetected mode works best with Google Chrome. If it can go undetected using Chrome, it will probably be best switch to Chrome (currently Chromium is used). Here's the Docker image for that
FROM python:3.12-slim WORKDIR /app # Define so the script knows not to download a new driver version, as # this Docker image already downloads a compatible chromedriver ENV AUTO_SOUTHWEST_CHECK_IN_DOCKER 1 RUN apt-get update && apt-get upgrade RUN apt-get install -y wget RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb RUN apt-get install -y ./google-chrome-stable_current_amd64.deb COPY requirements.txt requirements.txt RUN pip3 install --upgrade pip && pip3 install --no-cache-dir -r requirements.txt COPY . . ENTRYPOINT ["python3", "-u", "southwest.py"]
Thanks @jdholtz I'll give it a try.
I am also still reaching 429s when logging in. This PR doesn't appear to handle errors for logging in, only using reservations, but it would be nice to get both of those working to a similar level.
SeleniumBase's undetected mode works best with Google Chrome. If it can go undetected using Chrome, it will probably be best switch to Chrome (currently Chromium is used). Here's the Docker image for that
FROM python:3.12-slim WORKDIR /app # Define so the script knows not to download a new driver version, as # this Docker image already downloads a compatible chromedriver ENV AUTO_SOUTHWEST_CHECK_IN_DOCKER 1 RUN apt-get update && apt-get upgrade RUN apt-get install -y wget RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb RUN apt-get install -y ./google-chrome-stable_current_amd64.deb COPY requirements.txt requirements.txt RUN pip3 install --upgrade pip && pip3 install --no-cache-dir -r requirements.txt COPY . . ENTRYPOINT ["python3", "-u", "southwest.py"]
@jdholtz how can we download and install correct version for arm64/amd64/armv7 Dynamically based on our platform?
RUN apt-get install -y ./google-chrome-stable_current_amd64.deb
@jdholtz how can we download and install correct version for arm64/amd64/armv7 Dynamically based on our platform?
I'm not sure, but what we could do is have a script that downloads the correct one based off of the architecture. However, I'm not sure if Chrome even supports ARMv7. For right now though, this is just a proof of concept to see if it works, so it doesn't need to be dynamic yet.
@jdholtz how can we download and install correct version for arm64/amd64/armv7
Dynamically based on our platform?
I'm not sure, but what we could do is have a script that downloads the correct one based off of the architecture. However, I'm not sure if Chrome even supports ARMv7. For right now though, this is just a proof of concept to see if it works, so it doesn't need to be dynamic yet.
Got it thanks
@jdholtz try this approach. Thanks
@jdholtz try this approach. Thanks
Account logins are working for me now, awesome! I am still receiving 403s during fare checks though unfortunately.
Also, could you change this PR to merge into the develop
branch? You may have to rebase your branch to use the latest updates and remove the merge conflicts.
@jdholtz try this approach. Thanks
Account logins are working for me now, awesome! I am still receiving 403s during fare checks though unfortunately.
Also, could you change this PR to merge into the
develop
branch? You may have to rebase your branch to use the latest updates and remove the merge conflicts.
I checked my docker logs and it's been running on amd64 for 11 hours and 4 hr interval checks. No 429 or 403 errors. I'm still trying to understand why 403 is coming for you?
Also, could you change this PR to merge into the
develop
branch? You may have to rebase your branch to use the latest updates and remove the merge conflicts.
Yes, I will make a PR to develop branch.
FYI - here is my logs I just ran right now from docker (arm64): sw_logs_docker_arm64.txt
Let me know what system you are running on, we might need to exclude it from using mobile=True
I currently excluded 'Darwin' and 'Win32'
@jdholtz also another thing is that I'm using NextDNS throughout my entire network. So I'm not sure if this is helpful in avoiding 403's - just a thought
Let me know what system you are running on, we might need to exclude it from using mobile=True
I’m running on a Linux amd64.
@jdholtz also another thing is that I'm using NextDNS throughout my entire network. So I'm not sure if this is helpful in avoiding 403's - just a thought
I’m actually running NextDNS on my system too (not my entire network though). I’d be surprised if it actually affects 403s at all.
I do wonder what could be causing it since I'm not running a VPN for my Ubuntu or the dockers associated with the script.
However I do have my DNS as 1.1.1.1 and 1.0.0.1, but I don't see why that has anything to do with it...
Why did this get closed? I was looking forward to this fix.
@jdholtz @dmytrokoren @Bubba8291 Same here. why wasn't this merged in?
@Bubba8291 @bradzab0623 there was a conflict in merge, plus v7.5 was merged to master. So I have raised a new PR to develop branch. Feel free to test out my docker image (develop5 or latest)
Applied fix for error 403 and 429