Fix ctime and add auth warning

This commit is contained in:
Jxck-S 2020-09-19 20:01:43 -04:00
parent 9b5edaa9a3
commit 59f67411fa
1 changed files with 7 additions and 1 deletions

View File

@ -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