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

Fare checker monitors wrong fares #92

Closed
babehboi opened this issue May 12, 2023 · 19 comments
Closed

Fare checker monitors wrong fares #92

babehboi opened this issue May 12, 2023 · 19 comments
Labels
bug Something isn't working

Comments

@babehboi
Copy link

Description

So I noticed something interesting based on the logs. Noticed that it stated WGARED not available.

It appears this may be due to when the checker is checking points versus paid fare?

I've added some screenshots to confirm if this is a supported feature.

To Reproduce

  1. Run with a flight using points as payment.

Expected Behavior

Not sure, this could be expected and not a supported feature.

Version

4.0

Additional context

2023-05-12 13:33:17 DEBUG Process-3[fare_checker]: Found 10 matching flights
2023-05-12 13:33:17 DEBUG Process-3[fare_checker]: Fare WGARED is not availiable. Setting price difference to 0 USD
2023-05-12 13:33:17 DEBUG Process-3[fare_checker]: Flight price change found for 0 USD

image

@babehboi babehboi added the bug Something isn't working label May 12, 2023
@jdholtz
Copy link
Owner

jdholtz commented May 12, 2023

If I understand your question correctly, this is expected. Southwest does not have any more fares available for that flight (according to your screenshot), so the script just sets the price difference to the default of 0. Is there something else that you expected it to do?

@babehboi
Copy link
Author

The screen actually shows that there are flights available unless I'm mistaken?

@babehboi
Copy link
Author

You will notice that the flight is the 2nd one that would cost additional points/$

@jdholtz
Copy link
Owner

jdholtz commented May 13, 2023

Oh, so it picked the wrong flight? Currently, it only checks the departure time, so I will have to add a check for the arrival time as well.

@babehboi
Copy link
Author

Ah bingo!

@jdholtz
Copy link
Owner

jdholtz commented May 13, 2023

Hey @babehboi. I published a fix on the fix_wrong_flight_fare branch. Could you test it out to verify that it works?

@fusionneo
Copy link
Contributor

Maybe instead of looking at departure time/arrival time, it would be better to compare the flight numbers to be certain it is the same flight. It's hard to imagine an edge case where there's a flight departing and arriving at the exact same time, but I also thought just checking departure time was safe so... you never know.

@jdholtz
Copy link
Owner

jdholtz commented May 14, 2023

I thought of that as well, but apparently the JSON that is received from Southwest for the flight has an array of flights objects that carry the flight number. I haven’t seen it with more than one element, but I wasn’t sure if it could have more than one, so I went with the time comparisons to be safe.

@babehboi
Copy link
Author

Hey there, just got around to pulling your update:

remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 9 (delta 5), reused 8 (delta 5), pack-reused 0
Unpacking objects: 100% (9/9), 3.78 KiB | 1.26 MiB/s, done.
From https://github.com/jdholtz/auto-southwest-check-in

  • [new branch] fix_wrong_flight_fare -> origin/fix_wrong_flight_fare
    Already up to date.

followed with: python3 southwest.py --verbose

2023-05-15 07:34:20 DEBUG Process-3[fare_checker]: Found 10 matching flights
2023-05-15 07:34:20 DEBUG Process-3[fare_checker]: Fare WGARED is not availiable. Setting price difference to 0 USD
2023-05-15 07:34:20 DEBUG Process-3[fare_checker]: Flight price change found for 0 USD

I was thinking on your thought process too about flight numbers, not sure if the flight number will show both as in this case they both start with the same flight number and have separate legs?

After running it again, WGARED still an issue? Maybe I'm doing something wrong?

@jdholtz
Copy link
Owner

jdholtz commented May 15, 2023

not sure if the flight number will show both as in this case they both start with the same flight number and have separate legs

That was mainly the reason I was hesitant about using flight numbers. I wanted to ensure the correct flight was picked and I didn’t know if a round trip flight could have the same flight number.

After running it again, WGARED still an issue? Maybe I'm doing something wrong?

Is your flight’s departure time at 6:05 AM and arrival time at 2:55 PM?

@babehboi
Copy link
Author

Yup! The screenshot shows the flight we've booked.

@jdholtz
Copy link
Owner

jdholtz commented May 15, 2023

Oh sorry, I did not see that in the screenshot. Is the fare still available?

What website are you using to view the fares? The website the script requests to is https://mobile.southwest.com/air/change/shopping/adult/outbound/results. I attached a screenshot below of what that page looks like for me, which is different than the one you showed. I get the same display when checking a flight that was purchased with points as well.
Southwest

@babehboi
Copy link
Author

I did a screenshot via goign to www.southwest.com, but let me see what happens when I go on the phone...as of this morning it was still available.

@babehboi
Copy link
Author

It would seem available, I wonder if it's just how the values are being pulled... $/Pts.?

Phone Screenshot
WhatsApp Image 2023-05-15 at 11 01 33 AM

Desktop Screenshot
image

@jdholtz
Copy link
Owner

jdholtz commented May 15, 2023

Thanks for verifying. Could you add the line print(new_flight) on line 53 of lib/fare_checker.py and send the output? This will allow me to debug this issue further. There shouldn't be any private information (besides the airport and times which you have already sent), but feel free to remove anything if you want to.

@babehboi
Copy link
Author

confirm this is the correct place you wanted me to add that line?
image

seems like the variable wasnt' defined?
image

@jdholtz
Copy link
Owner

jdholtz commented May 15, 2023

Oh, I see the problem. The changes I made don’t seem to be applied to the fare checker.

I changed the line a few lines above that (if new_flight["departure_time"]…) but those changes don’t appear in the screenshot. Just to make sure, can you run git pull and git checkout fix_wrong_flight_fare? Your output above indicated that you did that, but apparently that didn’t work. After, you can check the same file again and line 53 should be return self._get_matching_fare(…)

Edit: It appears that you never switched to the branch. That’s my fault as I should have told you how to do that from the start.

@babehboi
Copy link
Author

I think that seemed to work. Yeah, I definitely didn't know how to switch the branch, I figured I should have looked that up, but learned something new today.

Here's the output. Seems to be working =). I'll put in the rest of the config file now and see how that fairs.

2023-05-15 13:44:36 DEBUG Process-1[checkin_scheduler]: Removing departed flights. Currently have 1 flights scheduled
2023-05-15 13:44:36 DEBUG Process-1[checkin_scheduler]: Successfully removed departed flights. 1 flights are now scheduled
2023-05-15 13:44:36 DEBUG Process-1[flight_retriever]: Checking fares for 1 flights
2023-05-15 13:44:36 DEBUG Process-1[fare_checker]: Checking current price for flight
2023-05-15 13:44:36 DEBUG Process-1[fare_checker]: Fetching reservation information
2023-05-15 13:44:36 DEBUG Process-1:1[checkin_handler]: Sleeping until ten minutes before check-in...
2023-05-15 13:44:38 DEBUG Process-1[utils]: Successfully made request after 1 attempts
2023-05-15 13:44:38 DEBUG Process-1[fare_checker]: Retrieving search information for the current flight
2023-05-15 13:44:40 DEBUG Process-1[utils]: Successfully made request after 1 attempts
2023-05-15 13:44:40 DEBUG Process-1[fare_checker]: Retrieving matching flights
2023-05-15 13:44:43 DEBUG Process-1[utils]: Successfully made request after 1 attempts
2023-05-15 13:44:43 DEBUG Process-1[fare_checker]: Found 10 matching flights
2023-05-15 13:44:43 DEBUG Process-1[fare_checker]: Flight price change found for +3,551 PTS
2023-05-15 13:44:43 DEBUG Process-1[flight_retriever]: Sleeping for 86393 seconds

@jdholtz
Copy link
Owner

jdholtz commented May 15, 2023

Awesome. Thanks for all the testing you did!

@jdholtz jdholtz changed the title Points vs Paid Fares Fare checker monitors wrong fares Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants