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
453 stars 86 forks source link

Apprise API not working for notification #309

Open justinrhodes opened 1 week ago

justinrhodes commented 1 week ago

Version

Auto-Southwest Check-In v8.0

Browser Version

Chromium

Description

Notifications are no longer working for me. I have been using the Apprise API (set up in a separate docker container) to attach to my Pushover account. I was using the format: "notification_urls": "apprise://<IP_OF_DOCKER_HOST>:8000/apprise/?tags=all" which was working for a while but has recently stopped. I reset all my configurations in Apprise, but I am still not able to get notifications through the southwest auto-checkin script here. I know it's not an issue with Apprise because I can use the curl command and it send the notification just fine. I also don't see any errors when using verbose.

Did the formatting of notification_urls change?

To Reproduce

  1. Setup apprise api notification url
  2. run check-in script

Expected Behavior

No response

Relevant logs and program output

No response

Additional context

No response

jdholtz commented 1 week ago

I cannot reproduce this issue using a Discord webhook. I can try with an apprise:// URL though. Do you get notifications when executing python southwest.py -v --test-notifications? If not, can you send the output of that command?

justinrhodes commented 1 week ago
~ $ python southwest.py -v --test-notifications
2024-10-14 16:42:52 DEBUG MainProcess[log:24]: Initialized the application
2024-10-14 16:42:52 DEBUG MainProcess[main:113]: Auto-Southwest Check-In v8.0
2024-10-14 16:42:52 DEBUG MainProcess[main:71]: Called with 1 arguments
2024-10-14 16:42:52 DEBUG MainProcess[config:143]: Initializing configuration file
2024-10-14 16:42:52 DEBUG MainProcess[config:172]: Reading the configuration file
2024-10-14 16:42:52 DEBUG MainProcess[config:185]: Reading configuration from environment variables
2024-10-14 16:42:52 DEBUG MainProcess[config:73]: Setting check fares to <CheckFaresOption.SAME_FLIGHT: 'same_flight'>
2024-10-14 16:42:52 DEBUG MainProcess[config:120]: Setting notification level to <NotificationLevel.NOTICE: 1>
2024-10-14 16:42:52 DEBUG MainProcess[config:133]: Using 1 notification services
2024-10-14 16:42:52 DEBUG MainProcess[config:162]: Creating configurations for 1 reservations
2024-10-14 16:42:52 INFO MainProcess[main:45]: Sending test notifications to 1 sources
This is a test message

I did not receive a pushover notification from this.

justinrhodes commented 1 week ago

interestingly, if I set the EV AUTO_SOUTHWEST_CHECK_IN_NOTIFICATION_URL to the same pushover URL it works.

jdholtz commented 1 week ago

interestingly, if I set the EV AUTO_SOUTHWEST_CHECK_IN_NOTIFICATION_URL to the same pushover URL it works.

Does using the EV or config file with the apprise://<IP_OF_DOCKER_HOST>:8000/apprise/?tags=all URL work? If not, it may be an issue with that URL (but its strange that it used to work and now it isn't). Do you have the same issue on prior versions of this script where you know it worked before?

justinrhodes commented 1 week ago

Does using the EV or config file with the apprise://:8000/apprise/?tags=all URL work?

No, I've resorted to passing the EV in with the pover://<user_key>@<token> when I run the Docker command. This seems to work. Placing that same URL into the config file does not work. So it seems the script is having an issue parsing the config file into the EV when the docker container is run.

jdholtz commented 1 week ago

You can test to see what the parsed URL is by adding print(notification_urls) to line 44 of lib/main.py. Also, it’s possible some special characters are being parsed incorrectly, so it may be worth trying to escape them to see if that fixes the issue.

If the apprise URL isn’t working with either way, you can try running it with apprise --body="text" apprise://<IP_OF_DOCKER_HOST>:8000/apprise/?tags=all (you may have to look at the official documentation for the exact syntax). I tried using an apprise URL yesterday with the Docker container and wasn’t able to send a notification successfully so I don’t 100% know how it works.