Browse Source

Fix anonymous OpenSky API access

pull/2/head
Jack Sweeney 4 years ago committed by GitHub
parent
commit
5f8e91caba
  1. 6
      defOpenSky.py

6
defOpenSky.py

@ -1,10 +1,10 @@
def pullOpenSky(planes):
import configparser
config = configparser.ConfigParser()
config.read('mainconf.ini')
main_config = configparser.ConfigParser()
main_config.read('mainconf.ini')
from opensky_api import OpenSkyApi
planeData = None
opens_api = OpenSkyApi(config.get('OPENSKY', 'USERNAME'), config.get('OPENSKY', 'PASSWORD'))
opens_api = OpenSkyApi(username= None if main_config.get('OPENSKY', 'USERNAME').upper() == "NONE" else main_config.get('OPENSKY', 'USERNAME'), password= None if main_config.get('OPENSKY', 'PASSWORD').upper() == "NONE" else main_config.get('OPENSKY', 'PASSWORD').upper())
failed = False
icao_array = []
for key, obj in planes.items():

Loading…
Cancel
Save