Fffrank / southwest-alerts

MIT License
19 stars 9 forks source link

TypeError: 'NoneType' object is not subscriptable #3

Closed thoranx closed 3 years ago

thoranx commented 4 years ago

Getting this error both when running locally or via docker


# python3 southwestalerts/app.py
[I:pyppeteer.launcher] Browser listening on: ws://127.0.0.1:51567/devtools/browser/dda6640b-c357-435f-9e91-755d2776d6bb
[I:pyppeteer.launcher] terminate chrome process...
Traceback (most recent call last):
  File "southwestalerts/app.py", line 188, in <module>
    check_for_price_drops(user.username, user.password, user.email, user.headers)
  File "southwestalerts/app.py", line 60, in check_for_price_drops
    southwest = Southwest(username, password, headers)
  File "/home/ubuntu/southwest-alerts/southwestalerts/southwest.py", line 18, in __init__
    self._session = _SouthwestSession(username, password, headers)
  File "/home/ubuntu/southwest-alerts/southwestalerts/southwest.py", line 86, in __init__
    self._login(username, password, headers)
  File "/home/ubuntu/southwest-alerts/southwestalerts/southwest.py", line 92, in _login
    'X-API-Key': headers['x-api-key'],
TypeError: 'NoneType' object is not subscriptable
Fffrank commented 4 years ago

This makes me feel like your pyppeteer is failing (although I usually get a different error message.) Feel free to try and the new test branch and report back.

thoranx commented 4 years ago

Thanks for working on this. No longer erroring out when using the test branch. However, not sure how it is calculating the increase. When I go to change my flight in southwest I only see a increase of 57 points for both flights. but this thing is telling me there was an increase of 8821 points.

Fffrank commented 4 years ago

Can you verify by running the script and then searching on southwest.com for the flight? I haven't had any errors in the routine that does the math on the existing flight vs. the new flight -- and it's not grabbing the new flight price via the change-flight button -- instead it is querying the southwest server for the price of booking a new flight.

I'm not aware of there being a reason for a difference in the southwest "change flight" option vs booking a new flight -- but stranger things have been known to happen!

Let me know what you see?

tjs198 commented 4 years ago

is this working by any chance? I'm getting very similar error (sorry don't know much, if not nothing, about coding):

[I:pyppeteer.launcher] Browser listening on: ws://127.0.0.1:34853/devtools/browser/5d5860a7-3043-4ff1-bf21-41760b7699b0 [I:pyppeteer.launcher] terminate chrome process... Traceback (most recent call last): File "/app/southwestalerts/app.py", line 187, in check_for_price_drops(user.username, user.password, user.email, user.headers) File "/app/southwestalerts/app.py", line 59, in check_for_price_drops southwest = Southwest(username, password, headers) File "/app/southwestalerts/southwest.py", line 18, in init self._session = _SouthwestSession(username, password, headers) File "/app/southwestalerts/southwest.py", line 86, in init self._login(username, password, headers) File "/app/southwestalerts/southwest.py", line 92, in _login 'X-API-Key': headers['x-api-key'], TypeError: 'NoneType' object is not subscriptable

Fffrank commented 3 years ago

Going to update and then it should work again. Feel free to test if you have reservations booked.

tjs198 commented 3 years ago

thanks! is this what I should be seeing (changed private info to XXXXX)

mac-mini:~ XXXX$ docker run -e MAILGUN_DOMAIN=XXXXXX.maingun.org -e MAILGUN_API_KEY=key-XXXXXXXXXXXXXX -e USERNAME1=XXXX -e PASSWORD1=XXXXXX -e EMAIL1=XXXXXX fffrank/southwest-alerts WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested [I:pyppeteer.launcher] Browser listening on: ws://127.0.0.1:47949/devtools/browser/b7fba509-5218-480a-ad22-cdcf878e4c83 [I:pyppeteer.connection] connection closed

Fffrank commented 3 years ago

You'll have to run it from source. There are directions in the readme. I don't know the ins and outs of building for different architectures such as arm64 (although I can work on it to see what might be possible -- I can already see it's not possible using the autobuild on docker hub.)

tjs198 commented 3 years ago

got this from option 2: mac-mini:southwest-alerts tjs$ python southwestalerts/app.py File "southwestalerts/app.py", line 19 async def catch_response(response): ^ SyntaxError: invalid syntax

Fffrank commented 3 years ago

Need to be running python 3.3+