Browse Source

Merge branch 'multi' of https://github.com/Jxck-S/plane-notify into multi

pull/2/head
Jxck-S 4 years ago
parent
commit
a986beb950
  1. 3
      README.md
  2. 12
      defADSBX.py

3
README.md

@ -124,7 +124,6 @@ python3 NotifyBotMulti.py
### TODO
- General Cleanup
- Add ADSBX V2 use (not really possible unless theyd give me access, luckly if we get to keep V1 use ADSBX may be taking away Free API apparently, THANKS ALOT)
- Get rid of landing/takeoff by data loss/aqquision instead use to last contact timeout for landing.
- Add ADSBX V2 use (not really possible unless i get access, luckly if i to keep V1 use ADSBX may be taking away Free API possibly THANKS ALOT PPL who have to abuse)
### [More Refrences/Documentation](Refrences.md)

12
defADSBX.py

@ -57,15 +57,13 @@ def pullADSBX(planes):
if "response" in locals():
print ("HTTP Status Code:", response.status_code)
if failed is False:
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'])
if data['msg'] != "No error":
raise Exception("Error from ADSBX: msg = ", data['msg'])
failed = True
except KeyError:
pass
data_ctime = float(data['ctime']) / 1000.0
print("UTC of Data:",datetime.utcfromtimestamp(data_ctime))
print("Current UTC:", datetime.utcnow())
return data, failed

Loading…
Cancel
Save