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
460 stars 89 forks source link

2nd flight on same day didn't checkin successfully #266

Open mhardin opened 5 months ago

mhardin commented 5 months ago

Version

Auto-Southwest Check-In v7.4

Browser Version

125.0.6422.76

Description

I had a roundtrip flight (both legs on the same day), and the script acted like my 2nd leg got the same boarding position as the first. In reality, it never checked me in for the 2nd leg. When I manually checked in for the 2nd leg from DES2 to DES1, I had a B35 boarding group.

To Reproduce

Book a flight with both legs on the same day. Run the checkin script for the confirmation number.

Expected Behavior

No response

Relevant logs and program output

matthew@Matthews-Mini-5 auto-southwest-check-in % python3 southwest.py <confirmation_code> matthew
Successfully scheduled the following flights to check in for matthew:
Flight from DES1 to DES2 on 2024-05-29 7:20 AM PDT
Flight from DES2 to DES1 on 2024-05-29 9:45 AM PDT

Checking in to flight from 'DES1' to 'DES2' for matthew

Successfully checked in to flight from 'DES1' to 'DES2' for matthew!
Matthew got A57!

Checking in to flight from 'DES2' to 'DES1' for matthew

Successfully checked in to flight from 'DES2' to 'DES1' for matthew!
Matthew got A57!

Additional context

No response

jdholtz commented 5 months ago

Thanks for filing this issue. It was supposed to be fixed in v7.4 (#241). Can you send the log file of the check-in (in logs/auto-southwest-check-in.log)?

mhardin commented 5 months ago

Hi, this should be the applicable logs for today (when the checkin happened).

2024-05-28 06:49:55 DEBUG Process-1:1[checkin_handler:100]: Acquiring lock...
2024-05-28 06:49:55 DEBUG Process-1:1[checkin_handler:102]: Lock acquired
2024-05-28 06:49:55 DEBUG Process-1:1[checkin_scheduler:51]: Refreshing headers for current session
2024-05-28 06:49:55 DEBUG Process-1:1[webdriver:133]: Starting webdriver for current session (this may take a few minutes)
2024-05-28 06:49:57 DEBUG Process-1:1[webdriver:149]: Using browser version: 125.0.6422.78
2024-05-28 06:49:57 DEBUG Process-1:1[webdriver:153]: Loading Southwest check-in page (this may take a few minutes)
2024-05-28 06:50:02 DEBUG Process-1:1[webdriver:88]: Waiting for valid headers
2024-05-28 06:50:02 DEBUG Process-1:1[webdriver:182]: Waiting for headers_set to be set
2024-05-28 06:50:02 DEBUG Process-1:1[webdriver:186]: headers_set set successfully
2024-05-28 06:50:03 DEBUG Process-1:1[checkin_handler:105]: Lock released
2024-05-28 06:50:03 DEBUG Process-1:1[checkin_handler:109]: Sleeping until check-in: 1791 seconds...
2024-05-28 07:19:55 DEBUG Process-1:1[checkin_handler:128]: Attempting to check in
2024-05-28 07:19:55 DEBUG Process-1:1[checkin_handler:156]: Submitting check-in with a POST request
2024-05-28 07:19:55 DEBUG Process-1:1[checkin_handler:188]: Making GET request to check in
2024-05-28 07:20:05 DEBUG Process-1:1[utils:43]: Successfully made request after 5 attempts
2024-05-28 07:20:05 DEBUG Process-1:1[checkin_handler:194]: Making POST request to check in
2024-05-28 07:20:08 DEBUG Process-1:1[utils:43]: Successfully made request after 1 attempts
2024-05-28 07:20:08 DEBUG Process-1:1[checkin_handler:164]: Successfully checked in after 1 attempts
2024-05-28 07:20:08 DEBUG Process-1:1[notification_handler:103]: Sending successful check-in notification...
2024-05-28 08:29:18 DEBUG Process-1[reservation_monitor:62]: Acquiring lock...
2024-05-28 08:29:18 DEBUG Process-1[reservation_monitor:64]: Lock acquired
2024-05-28 08:29:18 DEBUG Process-1[checkin_scheduler:51]: Refreshing headers for current session
2024-05-28 08:29:18 DEBUG Process-1[webdriver:133]: Starting webdriver for current session (this may take a few minutes)
2024-05-28 08:29:20 DEBUG Process-1[webdriver:149]: Using browser version: 125.0.6422.78
2024-05-28 08:29:20 DEBUG Process-1[webdriver:153]: Loading Southwest check-in page (this may take a few minutes)
2024-05-28 08:29:20 DEBUG Process-1[webdriver:88]: Waiting for valid headers
2024-05-28 08:29:20 DEBUG Process-1[webdriver:182]: Waiting for headers_set to be set
2024-05-28 08:29:25 DEBUG Process-1[webdriver:186]: headers_set set successfully
2024-05-28 08:29:25 DEBUG Process-1[reservation_monitor:86]: Scheduling flight check-ins for 1 reservations
2024-05-28 08:29:25 DEBUG Process-1[checkin_scheduler:79]: Retrieving reservation information
2024-05-28 08:29:28 DEBUG Process-1[utils:43]: Successfully made request after 1 attempts
2024-05-28 08:29:28 DEBUG Process-1[checkin_scheduler:92]: Successfully retrieved reservation information
2024-05-28 08:29:28 DEBUG Process-1[checkin_scheduler:58]: 2 flights found under current reservation
2024-05-28 08:29:28 DEBUG Process-1[checkin_scheduler:99]: Flight is on the same day
2024-05-28 08:29:28 DEBUG Process-1[checkin_scheduler:44]: 2 total flights were found
2024-05-28 08:29:28 DEBUG Process-1[checkin_scheduler:110]: 0 new flights found
2024-05-28 08:29:28 DEBUG Process-1[checkin_scheduler:114]: Scheduling 0 flights for check-in
2024-05-28 08:29:28 DEBUG Process-1[checkin_scheduler:126]: 2 flights are currently scheduled. Removing old flights
2024-05-28 08:29:28 DEBUG Process-1[checkin_scheduler:145]: Successfully removed old flights. 2 flights are now scheduled
2024-05-28 08:29:28 DEBUG Process-1[reservation_monitor:95]: Checking fares for 2 flights
2024-05-28 08:29:28 DEBUG Process-1[fare_checker:30]: Checking current price for flight
2024-05-28 08:29:28 DEBUG Process-1[fare_checker:88]: Retrieving reservation information
2024-05-28 08:29:32 DEBUG Process-1[utils:43]: Successfully made request after 1 attempts
2024-05-28 08:29:32 DEBUG Process-1[fare_checker:103]: Retrieving search information for the current flight
2024-05-28 08:29:35 DEBUG Process-1[utils:43]: Successfully made request after 1 attempts
2024-05-28 08:29:35 DEBUG Process-1[fare_checker:82]: Retrieving matching flights
2024-05-28 08:29:37 DEBUG Process-1[utils:43]: Successfully made request after 1 attempts
2024-05-28 08:29:37 DEBUG Process-1[fare_checker:50]: Found 26 matching flights
2024-05-28 08:29:37 DEBUG Process-1[fare_checker:37]: Flight price change found for +40 USD
2024-05-28 08:29:37 DEBUG Process-1[fare_checker:30]: Checking current price for flight
2024-05-28 08:29:37 DEBUG Process-1[fare_checker:88]: Retrieving reservation information
2024-05-28 08:29:40 DEBUG Process-1[utils:43]: Successfully made request after 1 attempts
2024-05-28 08:29:40 DEBUG Process-1[fare_checker:103]: Retrieving search information for the current flight
2024-05-28 08:29:42 DEBUG Process-1[utils:43]: Successfully made request after 1 attempts
2024-05-28 08:29:42 DEBUG Process-1[fare_checker:82]: Retrieving matching flights
2024-05-28 08:29:44 DEBUG Process-1[utils:43]: Successfully made request after 1 attempts
2024-05-28 08:29:44 DEBUG Process-1[fare_checker:50]: Found 26 matching flights
2024-05-28 08:29:44 DEBUG Process-1[fare_checker:37]: Flight price change found for +46 USD
2024-05-28 08:29:44 DEBUG Process-1[reservation_monitor:82]: Lock released
2024-05-28 08:29:44 DEBUG Process-1[reservation_monitor:130]: Sleeping for 86373 seconds
2024-05-28 09:14:55 DEBUG Process-1:2[checkin_handler:100]: Acquiring lock...
2024-05-28 09:14:55 DEBUG Process-1:2[checkin_handler:102]: Lock acquired
2024-05-28 09:14:55 DEBUG Process-1:2[checkin_scheduler:51]: Refreshing headers for current session
2024-05-28 09:14:55 DEBUG Process-1:2[webdriver:133]: Starting webdriver for current session (this may take a few minutes)
2024-05-28 09:14:57 DEBUG Process-1:2[webdriver:149]: Using browser version: 125.0.6422.78
2024-05-28 09:14:57 DEBUG Process-1:2[webdriver:153]: Loading Southwest check-in page (this may take a few minutes)
2024-05-28 09:14:57 DEBUG Process-1:2[webdriver:88]: Waiting for valid headers
2024-05-28 09:14:57 DEBUG Process-1:2[webdriver:182]: Waiting for headers_set to be set
2024-05-28 09:15:02 DEBUG Process-1:2[webdriver:186]: headers_set set successfully
2024-05-28 09:15:03 DEBUG Process-1:2[checkin_handler:105]: Lock released
2024-05-28 09:15:03 DEBUG Process-1:2[checkin_handler:109]: Sleeping until check-in: 1791 seconds...
2024-05-28 09:44:54 DEBUG Process-1:2[checkin_handler:128]: Attempting to check in
2024-05-28 09:44:54 DEBUG Process-1:2[checkin_handler:156]: Submitting check-in with a POST request
2024-05-28 09:44:54 DEBUG Process-1:2[checkin_handler:188]: Making GET request to check in
2024-05-28 09:44:56 DEBUG Process-1:2[utils:43]: Successfully made request after 1 attempts
2024-05-28 09:44:56 DEBUG Process-1:2[checkin_handler:194]: Making POST request to check in
2024-05-28 09:44:57 DEBUG Process-1:2[utils:43]: Successfully made request after 1 attempts
2024-05-28 09:44:57 DEBUG Process-1:2[checkin_handler:167]: Same-day flight has not been checked in yet. Waiting 1 second and trying again
2024-05-28 09:44:58 DEBUG Process-1:2[checkin_handler:188]: Making GET request to check in
2024-05-28 09:44:59 DEBUG Process-1:2[utils:43]: Successfully made request after 1 attempts
2024-05-28 09:44:59 DEBUG Process-1:2[checkin_handler:194]: Making POST request to check in
2024-05-28 09:45:01 DEBUG Process-1:2[utils:43]: Successfully made request after 1 attempts
2024-05-28 09:45:01 DEBUG Process-1:2[checkin_handler:167]: Same-day flight has not been checked in yet. Waiting 1 second and trying again
2024-05-28 09:45:02 DEBUG Process-1:2[checkin_handler:188]: Making GET request to check in
2024-05-28 09:45:03 DEBUG Process-1:2[utils:43]: Successfully made request after 1 attempts
2024-05-28 09:45:03 DEBUG Process-1:2[checkin_handler:194]: Making POST request to check in
2024-05-28 09:45:05 DEBUG Process-1:2[utils:43]: Successfully made request after 1 attempts
2024-05-28 09:45:05 DEBUG Process-1:2[checkin_handler:164]: Successfully checked in after 3 attempts
2024-05-28 09:45:05 DEBUG Process-1:2[notification_handler:103]: Sending successful check-in notification...
2024-05-28 09:49:37 INFO MainProcess[main:114]: 
Ctrl+C pressed. Stopping all check-ins
jdholtz commented 5 months ago

Thanks for sending those. Everything in the logs make it look like it worked as expected (it even verified the second flight was checked in before finishing). In this comment, for the second flight the boarding information displays twice. Was the line Matthew got A57! the only one displayed for the second flight?

mhardin commented 5 months ago

The Relevant logs and program output section above contained all console log output from the checkin process. I thought I just received A57 for both legs (which was a little strange). But a hard refresh on the Southwest app showed I was NOT checked in for the 2nd leg. Upon manually clicking the "checkin" button in the app, I showed a B35 boarding group.

Is it possible the process somehow thought the 2nd leg was checked in because it was looking at the first leg (which showed as checked in)? I haven't dived too deeply into the codebase to know if this would be a realistic outcome or not.

(btw, I scrubbed sensitive data from my output so that Southwest can't personally identify me as a customer, no idea if they monitor these types of things and ban people for doing this)

mhardin commented 5 months ago

Screenshot 2024-05-28 at 1 26 16 PM Here is a screenshot of console output with identifiable information redacted.

mhardin commented 5 months ago

@jdholtz can you scrub the last name from your comment? Thank you.

jdholtz commented 5 months ago

@jdholtz can you scrub the last name

Removed it and deleted the edited history too for both of our comments

jdholtz commented 5 months ago

@mhardin when you rerun the script, does it now report both boarding positions correctly?

mhardin commented 5 months ago

Interesting, here is what I see when I run it again. Looks like something in the logic is definitely not working as expected.

matthew@Matthews-Mini-5 auto-southwest-check-in % python3 southwest.py <confirmation_code> matthew 
Successfully scheduled the following flights to check in for matthew:
Flight from DES1 to DES2 on 2024-05-29 7:20 AM PDT
Flight from DES2 to DES1 on 2024-05-29 9:45 AM PDT

Checking in to flight from 'DES2' to 'DES1' for matthew

Checking in to flight from DES1' to 'DES2' for matthew

Successfully checked in to flight from 'DES1' to 'DES2' for matthew!
Matthew got A57!
Matthew got B35!

Successfully checked in to flight from 'DES2' to 'DES1' for matthew!
Matthew got A57!
Matthew got B35!
jdholtz commented 5 months ago

Interesting, here is what I see when I run it again. Looks like something in the logic is definitely not working as expected.

The hard part about this issue is that it can only really be seen right at check-in time of the second flight. Since it checks in 5 seconds early, it is looking for there to be two flights to have been checked in, not just one. After that, both check-in times will have passed so the check-ins won't be initiated 5 seconds before check-in time anymore.

Right now I'm clueless as to what could have gone wrong. Your log output is identical to another user's output where it checked in correctly to the second flight. Perhaps something changed on Southwest's end, but for this issue to be fixed, someone else will need to have run into this issue.

If you or someone else has a same day flight, it would be very helpful to add the line print(flights) on line 164 of lib/checkin_handler.py (right under flights = reservation["checkInConfirmationPage"]["flights"]) and attach that with the log in this issue (removing any identifying information).