From a464419b98a144431f807c3e3c851d956a413edd Mon Sep 17 00:00:00 2001 From: Jxck-S Date: Sat, 19 Sep 2020 20:01:43 -0400 Subject: [PATCH] Fix ctime and add auth warning --- defADSBX.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/defADSBX.py b/defADSBX.py index 374952f..9b03e87 100644 --- a/defADSBX.py +++ b/defADSBX.py @@ -31,9 +31,15 @@ def pullADSBX(planes): print(error_message) failed = True if failed is False: - data_ctime = data['ctime'] / 1000.0 + data_ctime = float(data['ctime']) / 1000.0 print("UTC of Data:",datetime.utcfromtimestamp(data_ctime)) print("Current UTC:", datetime.utcnow()) + try: + if data['msg'] == 'You need a key. Get a feeder or use pay API. https://rapidapi.com/adsbx/api/adsbexchange-com1': + print("Bad auth", data['msg']) + failed = True + except KeyError: + pass return data, failed