├── __init__.py ├── ExImages ├── GMapEX.png ├── DiscordEX.png ├── DiscordEX2.png ├── DiscordEX3.png ├── TwitterEX.png └── tar1090appendedEX.png ├── docker-compose.yml ├── .gitignore ├── defDiscord.py ├── Pipfile ├── Dockerfile ├── defMap.py ├── defOpenSky.py ├── mictronics_parse.py ├── PseudoCode.md ├── defRpdADSBX.py ├── configs ├── plane1.ini.example └── mainconf.ini.example ├── defMastodon.py ├── calculate_headings.py ├── defAirport.py ├── References.md ├── meta_toolkit.py ├── fuel_calc.py ├── modify_image.py ├── defADSBX.py ├── defTelegram.py ├── README.md ├── defSS.py ├── aircraft_type_fuel_consumption_rates.json ├── __main__.py ├── LICENSE ├── Pipfile.lock └── planeClass.py /__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ExImages/GMapEX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jxck-S/plane-notify/HEAD/ExImages/GMapEX.png -------------------------------------------------------------------------------- /ExImages/DiscordEX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jxck-S/plane-notify/HEAD/ExImages/DiscordEX.png -------------------------------------------------------------------------------- /ExImages/DiscordEX2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jxck-S/plane-notify/HEAD/ExImages/DiscordEX2.png -------------------------------------------------------------------------------- /ExImages/DiscordEX3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jxck-S/plane-notify/HEAD/ExImages/DiscordEX3.png -------------------------------------------------------------------------------- /ExImages/TwitterEX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jxck-S/plane-notify/HEAD/ExImages/TwitterEX.png -------------------------------------------------------------------------------- /ExImages/tar1090appendedEX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jxck-S/plane-notify/HEAD/ExImages/tar1090appendedEX.png -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | services: 3 | plane-notify: 4 | platform: linux/amd64 5 | shm_size: 2gb 6 | build: 7 | context: . 8 | volumes: 9 | - ./:/plane-notify 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | configs/*.ini 2 | 3 | # PyCharm 4 | .idea 5 | .vscode/settings.json 6 | pythonenv3.8/ 7 | __pycache__ 8 | dependencies 9 | testing 10 | lookup_route.py 11 | icao_url_gen.py 12 | install.sh 13 | coul_icao_gen.py 14 | test.py 15 | -------------------------------------------------------------------------------- /defDiscord.py: -------------------------------------------------------------------------------- 1 | def sendDis(message, config, role_id = None, *file_names): 2 | import requests 3 | from discord_webhook import DiscordWebhook 4 | if role_id != None: 5 | message += f" <@&{role_id}>" 6 | webhook = DiscordWebhook(url=config.get('DISCORD', 'URL'), content=message[0:1999], username=config.get('DISCORD', 'USERNAME')) 7 | 8 | if file_names != []: 9 | for file_name in file_names: 10 | with open(file_name, "rb") as f: 11 | webhook.add_file(file=f.read(), filename=file_name) 12 | try: 13 | webhook.execute() 14 | except requests.exceptions.RequestException: 15 | pass -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | name = "pypi" 3 | url = "https://pypi.org/simple" 4 | verify_ssl = true 5 | 6 | [dev-packages] 7 | 8 | [packages] 9 | colorama = "*" 10 | geopy = "*" 11 | tabulate = "*" 12 | pytz = "*" 13 | pillow = "*" 14 | tweepy = "*" 15 | discord-webhook = "*" 16 | selenium = "*" 17 | opensky-api = {editable = true, git = "https://github.com/openskynetwork/opensky-api.git", subdirectory = "python"} 18 | webdriver-manager = "*" 19 | shapely = "*" 20 | pycairo = "*" 21 | geog = "*" 22 | py-staticmaps = "*" 23 | pyproj = "*" 24 | pandas = "*" 25 | lxml = "*" 26 | beautifulsoup4 = "*" 27 | python-telegram-bot = "*" 28 | configparser = "*" 29 | "mastodon.py" = "*" 30 | 31 | [requires] 32 | python_version = "3.9" 33 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3 2 | 3 | WORKDIR /plane-notify 4 | 5 | # Added needed folder for plane-notify process 6 | RUN mkdir /home/plane-notify 7 | 8 | # Set the Chrome repo. 9 | RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ 10 | && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list 11 | 12 | # Install Chrome. 13 | RUN apt-get update && apt-get -y install --no-install-recommends \ 14 | google-chrome-stable \ 15 | python3-dev \ 16 | && apt-get clean \ 17 | && rm -rf /var/lib/apt/lists/* 18 | 19 | # Add pipenv 20 | RUN pip install pipenv 21 | 22 | # Install dependencies 23 | COPY Pipfile* . 24 | RUN pipenv install 25 | 26 | COPY . . 27 | CMD pipenv run python /plane-notify/__main__.py 28 | -------------------------------------------------------------------------------- /defMap.py: -------------------------------------------------------------------------------- 1 | def getMap(mapLocation, file_name): 2 | import requests 3 | import configparser 4 | config = configparser.ConfigParser() 5 | config.read('./configs/mainconf.ini') 6 | api_key = config.get('GOOGLE', 'API_KEY') 7 | url = "https://maps.googleapis.com/maps/api/staticmap?" 8 | 9 | center = str(mapLocation) 10 | zoom = 9 11 | 12 | r = requests.get(url + "center=" + center + "&zoom=" + 13 | str(zoom) + "&size=800x800 &key=" + 14 | api_key + "&sensor=false") 15 | 16 | # wb mode is stand for write binary mode 17 | f = open(file_name, 'wb') 18 | 19 | # r.content gives content, 20 | # in this case gives image 21 | f.write(r.content) 22 | 23 | # close method of file object 24 | # save and close the file 25 | f.close() -------------------------------------------------------------------------------- /defOpenSky.py: -------------------------------------------------------------------------------- 1 | def pull_opensky(planes): 2 | import configparser 3 | main_config = configparser.ConfigParser() 4 | main_config.read('./configs/mainconf.ini') 5 | from opensky_api import OpenSkyApi 6 | planeData = None 7 | opens_api = OpenSkyApi( 8 | username= None if main_config.get('OPENSKY', 'USERNAME').upper() == "NONE" else main_config.get('OPENSKY', 'USERNAME'), 9 | password= None if main_config.get('OPENSKY', 'PASSWORD').upper() == "NONE" else main_config.get('OPENSKY', 'PASSWORD')) 10 | failed = False 11 | icao_array = [] 12 | for key in planes.keys(): 13 | icao_array.append(key.lower()) 14 | try: 15 | planeData = opens_api.get_states(time_secs=0, icao24=icao_array) 16 | except Exception as e: 17 | print ("OpenSky Error", e) 18 | failed = True 19 | return planeData, failed -------------------------------------------------------------------------------- /mictronics_parse.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | folder = os.getcwd() + "/dependencies" 4 | def get_aircraft_reg_by_icao(icao): 5 | with open(folder + '/aircrafts.json') as aircrafts_json: 6 | aircraft = json.load(aircrafts_json) 7 | try: 8 | reg = aircraft[icao.upper()][0] 9 | except KeyError: 10 | reg = None 11 | return reg 12 | def get_type_code_by_icao(icao): 13 | with open(folder + '/aircrafts.json') as aircrafts_json: 14 | aircraft = json.load(aircrafts_json) 15 | try: 16 | type_code = aircraft[icao.upper()][1] 17 | except KeyError: 18 | type_code = None 19 | return type_code 20 | 21 | def get_type_desc(t): 22 | with open(folder + '/types.json') as types_json: 23 | types = json.load(types_json) 24 | return types[t.upper()] 25 | 26 | def get_db_ver(): 27 | with open(folder + '/dbversion.json') as dbver_json: 28 | dbver = json.load(dbver_json) 29 | return dbver["version"] 30 | def test(): 31 | print(get_aircraft_reg_by_icao("A835AF")) 32 | print(get_type_code_by_icao("A835AF")) 33 | print(get_type_desc("GLF6")) 34 | print(get_db_ver()) 35 | #test() -------------------------------------------------------------------------------- /PseudoCode.md: -------------------------------------------------------------------------------- 1 | ### How It works 2 | - Takes data about every (x seconds configurable) from OpenSky Network or ADS-B Exchange and compares it to previous data with what I've defined as a landing or takeoff event. 3 | - A takeoff event is the plane is not on the ground, below 10k feet and ((previously no data and now getting data) or was previously on the ground). 4 | - A landing event is previously below 10k feet and (previously getting data, no longer getting data and previously not on the ground) or (now on the ground and previously not on the ground). 5 | - Given the coordinates of the aircraft the nearest airport is found in an airport database from the distance is calculated using the Haversine formula. The state, region and country are also found in this database with the airport. 6 | - At the time of takeoff a takeoff time is set, which is referenced in the landing event to calculate approximate total flight time. 7 | - A Static map image is created based off location name. (Google Static Maps API) or a screenshot of is created using Selenium/ChromeDriver. The selected plane is locked on in the screenshot. 8 | - If the landing event or takeoff event is true, It will output to any of the following built-in output methods. (Twitter, Pushbullet, and Discord can all be setup and enabled in each plane's config file). Outputs the location name, map, image, and flight time on landing. (Tweepy and "Pushbullet.py" and Discord_webhooks) 9 | -------------------------------------------------------------------------------- /defRpdADSBX.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import configparser 3 | from datetime import datetime 4 | 5 | main_config = configparser.ConfigParser() 6 | main_config.read('./configs/mainconf.ini') 7 | api_version = main_config.get('RpdADSBX', 'API_VERSION') 8 | 9 | def pull_rpdadsbx(planes): 10 | api_version = int(main_config.get('RpdADSBX', 'API_VERSION')) 11 | if api_version != 2: 12 | raise ValueError("Bad RapidAPI ADSBX API Version") 13 | url = "https://adsbexchange-com1.p.rapidapi.com/v2/icao/" + planes + "/" 14 | headers = { 15 | "X-RapidAPI-Host": "adsbexchange-com1.p.rapidapi.com", 16 | "X-RapidAPI-Key": main_config.get('RpdADSBX', 'API_KEY') 17 | } 18 | try: 19 | response = requests.get(url, headers = headers, timeout=30) 20 | response.raise_for_status() 21 | data = response.json() 22 | if "msg" in data.keys() and data['msg'] != "No error": 23 | raise ValueError("Error from ADSBX: msg = ", data['msg']) 24 | if "ctime" in data.keys(): 25 | data_ctime = float(data['ctime']) / 1000.0 26 | print("Data ctime:",datetime.utcfromtimestamp(data_ctime)) 27 | if "now" in data.keys(): 28 | data_now = float(data['now']) / 1000.0 29 | print("Data now time:",datetime.utcfromtimestamp(data_now)) 30 | print("Current UTC:", datetime.utcnow()) 31 | return data 32 | except Exception as e: 33 | print('Error calling RapidAPI', e) 34 | return None 35 | -------------------------------------------------------------------------------- /configs/plane1.ini.example: -------------------------------------------------------------------------------- 1 | [DATA] 2 | #Plane to track, based off ICAO or ICAO24 which is the unique transponder address of a plane. 3 | ICAO = icaohere 4 | 5 | 6 | #Optional Per Plane Overrides 7 | ; OVERRIDE_REG= 8 | ; OVERRIDE_ICAO_TYPE= 9 | ; OVERRIDE_TYPELONG = 10 | ; OVERRIDE_OWNER = 11 | ; DATA_LOSS_MINS = 20 12 | ; CONCEAL_AC_ID = True 13 | ; CONCEAL_PIA = False 14 | 15 | [MAP] 16 | #Optional, map selection moved to mainconf, this is for map overlays per plane 17 | #Tar1090 overlays option, should be seperated by comma no space, remove option all together to disable any 18 | OVERLAYS = nexrad 19 | 20 | [AIRPORT] 21 | #Requires a list of airport types, this plane could land/takeoff at 22 | #Choices: small_airport, medium_airport, large_airport, heliport, seaplane_base 23 | TYPES = [small_airport, medium_airport, large_airport] 24 | 25 | #TITLE for Twitter, PB and Discord are Just text added to the front of each message/tweet sent 26 | [TWITTER] 27 | ENABLE = FALSE 28 | TITLE = 29 | ACCESS_TOKEN = athere 30 | ACCESS_TOKEN_SECRET = atshere 31 | 32 | [DISCORD] 33 | ENABLE = FALSE 34 | #WEBHOOK URL https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks 35 | URL = webhookurl 36 | #Role to tag optional, the role ID 37 | ROLE_ID = 38 | Title = 39 | USERNAME = plane-notify 40 | 41 | [META] 42 | ENABLE = False 43 | FB_PAGE_ID = 44 | IG_USER_ID = 45 | ACCESS_TOKEN = 46 | 47 | 48 | [TELEGRAM] 49 | ENABLE = FALSE 50 | TITLE = Title Of Telegram message 51 | ROOM_ID = -100xxxxxxxxxx 52 | BOT_TOKEN = xxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 53 | 54 | [MASTODON] 55 | ENABLE = FALSE 56 | ACCESS_TOKEN = mastodonaccesstoken 57 | APP_URL = mastodonappurl 58 | 59 | -------------------------------------------------------------------------------- /defMastodon.py: -------------------------------------------------------------------------------- 1 | def sendMastodon(photo, message, config): 2 | from mastodon import Mastodon 3 | sent = False 4 | retry_c = 0 5 | while sent == False: 6 | try: 7 | bot = Mastodon( 8 | access_token=config.get('MASTODON','ACCESS_TOKEN'), 9 | api_base_url=config.get('MASTODON','APP_URL') 10 | ) 11 | mediaid = bot.media_post(photo, mime_type="image/jpeg") 12 | sent = bot.status_post(message,None,mediaid,False, "Public") 13 | except Exception as err: 14 | print('err.args:') 15 | print(err.args) 16 | print(f"Unexpected {err=}, {type(err)=}") 17 | print("\nString err:\n"+str(err)) 18 | if retry_c > 4: 19 | print('Mastodon attempts exceeded. Message not sent.') 20 | break 21 | elif str(err) == 'Unauthorized': 22 | print('Invalid Mastodon bot token, message not sent.') 23 | break 24 | elif str(err) == 'Timed out': 25 | retry_c += 1 26 | print('Mastodon timeout count: '+str(retry_c)) 27 | pass 28 | elif str(err)[:35] == '[Errno 2] No such file or directory': 29 | print('Mastodon module couldn\'t find an image to send.') 30 | break 31 | elif str(err) == 'Media_caption_too_long': 32 | print('Mastodon image caption lenght exceeds 1024 characters. Message not send.') 33 | break 34 | else: 35 | print('[X] Unknown error. Message not sent.') 36 | break 37 | else: 38 | print("Mastodon message successfully sent.") 39 | return sent 40 | -------------------------------------------------------------------------------- /calculate_headings.py: -------------------------------------------------------------------------------- 1 | def calculate_from_bearing(frm, to): 2 | """Calculate inital bearing from one coordinate to next (two tuples of coordinates(lat/lng) in degrees in, returns single bearing)""" 3 | #https://gis.stackexchange.com/questions/228656/finding-compass-direction-between-two-distant-gps-points 4 | from math import atan2, cos, radians, sin, degrees 5 | frm = (radians(frm[0]), radians(frm[1])) 6 | to = (radians(to[0]), radians(to[1])) 7 | y = sin(to[1]- frm[1]) * cos(to[0]) 8 | x = cos(frm[0]) * sin(to[0]) - sin(frm[0]) * cos(to[0]) * cos(to[1]-frm[1]) 9 | from_bearing = degrees(atan2(y, x)) 10 | if from_bearing < 0: 11 | from_bearing += 360 12 | return from_bearing 13 | def calculate_cardinal(d): 14 | """Finds cardinal direction from bearing degree""" 15 | dirs = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW'] 16 | ix = int(round(d / (360. / len(dirs)))) 17 | card = dirs[ix % len(dirs)] 18 | return card 19 | def calculate_deg_change(new_heading, original_heading): 20 | """Calculates change between two headings, returns negative degree if change is left, positive if right""" 21 | if new_heading is None: 22 | print("Track heading missing. No change") 23 | return 0 24 | normal = abs(original_heading-new_heading) 25 | across_inital = 360 - abs(original_heading-new_heading) 26 | if across_inital < normal: 27 | direction = "left" if original_heading < new_heading else "right" 28 | track_change = across_inital 29 | else: 30 | direction = "right" if original_heading < new_heading else "left" 31 | track_change = normal 32 | if direction == "left": 33 | track_change *= -1 34 | track_change = round(track_change, 2) 35 | print(f"Track change of {track_change}° which is {direction}") 36 | return track_change 37 | 38 | -------------------------------------------------------------------------------- /configs/mainconf.ini.example: -------------------------------------------------------------------------------- 1 | [DATA] 2 | #Source to pull data from 3 | #SHOULD BE ADSBX which is ADS-B Exchange or OPENS which is OpenSky 4 | #By default configured with OpenSky which anyone can use without a login 5 | #ADS-B Exchange has better data but is not available unless you feed their network or pay. 6 | SOURCE = RpdADSBX 7 | #Default amount of time after data loss to trigger a landing when under 10k ft 8 | DATA_LOSS_MINS = 5 9 | #Failover from one source to the other, only enable if you have both sources setup. 10 | FAILOVER = FALSE 11 | #Timezone if you want your own time to show in the console, if invalid will be set to UTC. 12 | #List of TZs names https://en.wikipedia.org/wiki/List_of_tz_database_time_zones 13 | TZ = UTC 14 | 15 | #ADS-B Exchange https://www.adsbexchange.com/data/ 16 | [ADSBX] 17 | API_KEY = apikey 18 | API_VERSION = 1 19 | 20 | #ADSBX API Proxy, https://gitlab.com/jjwiseman/adsbx-api-proxy, v2 input, v1 or v2 output from proxy 21 | ENABLE_PROXY = FALSE 22 | #Full URL http://host:port 23 | PROXY_HOST = 24 | 25 | #OpenSky https://opensky-network.org/apidoc/index.html 26 | #When using without your own login user and pass should be None 27 | [OPENSKY] 28 | USERNAME = None 29 | PASSWORD = None 30 | 31 | #ADS-B Exchange on RapidAPI https://rapidapi.com/adsbx/api/adsbexchange-com1/ 32 | [RpdADSBX] 33 | API_KEY = none 34 | API_VERSION = 2 35 | 36 | #Define the delay interval in seconds between each data request. This is useful if you have limited requests in the API. 37 | [SLEEP] 38 | SLEEPSEC = 60 39 | 40 | [GOOGLE] 41 | #API KEY for Google Static Maps only if you using this on any of the planes. 42 | API_KEY = googleapikey 43 | 44 | #Used for failover messages and program exits notification 45 | [DISCORD] 46 | ENABLE = FALSE 47 | USERNAME = usernamehere 48 | URL = webhookurl 49 | ROLE_ID = 50 | 51 | [TFRS] 52 | URL = http://127.0.0.1:5000/detailed_all 53 | ENABLE = False 54 | 55 | [TWITTER] 56 | #GLOBAL TWITTER CONSUMER KEY AND CONSUMERS SECRET ONLY NEED TO BE HERE NOW 57 | ENABLE = False 58 | CONSUMER_KEY = ck 59 | CONSUMER_SECRET = cs 60 | 61 | [MAP] 62 | #Map to create from Google Static Maps or screenshot global tar1090 from globe.theairtraffic.com 63 | #Enter GOOGLESTATICMAP or ADSBX 64 | OPTION = ADSBX 65 | -------------------------------------------------------------------------------- /defAirport.py: -------------------------------------------------------------------------------- 1 | import csv 2 | import math 3 | def add_airport_region(airport_dict): 4 | #Get full region/state name from iso region name 5 | with open('./dependencies/regions.csv', 'r', encoding='utf-8') as regions_csv: 6 | regions_csv = csv.DictReader(filter(lambda row: row[0]!='#', regions_csv)) 7 | for region in regions_csv: 8 | if region['code'] == airport_dict['iso_region']: 9 | airport_dict['region'] = region['name'] 10 | return airport_dict 11 | def getClosestAirport(latitude, longitude, allowed_types): 12 | from geopy.distance import geodesic 13 | plane = (latitude, longitude) 14 | with open('./dependencies/airports.csv', 'r', encoding='utf-8') as airport_csv: 15 | airport_csv_reader = csv.DictReader(filter(lambda row: row[0]!='#', airport_csv)) 16 | for airport in airport_csv_reader: 17 | if airport['type'] in allowed_types: 18 | airport_coord = float(airport['latitude_deg']), float(airport['longitude_deg']) 19 | airport_dist = float((geodesic(plane, airport_coord).mi)) 20 | if "closest_airport_dict" not in locals(): 21 | closest_airport_dict = airport 22 | closest_airport_dist = airport_dist 23 | elif airport_dist < closest_airport_dist: 24 | closest_airport_dict = airport 25 | closest_airport_dist = airport_dist 26 | closest_airport_dict['distance_mi'] = closest_airport_dist 27 | #Convert indent key to icao key as its labeled icao in other places not ident 28 | closest_airport_dict['icao'] = closest_airport_dict.pop('gps_code') 29 | closest_airport_dict = add_airport_region(closest_airport_dict) 30 | return closest_airport_dict 31 | def get_airport_by_icao(icao): 32 | with open('./dependencies/airports.csv', 'r', encoding='utf-8') as airport_csv: 33 | matching_airport = None 34 | airport_csv_reader = csv.DictReader(filter(lambda row: row[0]!='#', airport_csv)) 35 | for airport in airport_csv_reader: 36 | if airport['gps_code'] == icao: 37 | matching_airport = airport 38 | #Convert indent key to icao key as its labeled icao in other places not ident 39 | matching_airport['icao'] = matching_airport.pop('gps_code') 40 | break 41 | if matching_airport: 42 | matching_airport = add_airport_region(matching_airport) 43 | return matching_airport 44 | else: 45 | return None -------------------------------------------------------------------------------- /References.md: -------------------------------------------------------------------------------- 1 | # Reference Links 2 | 3 | ## ADSB Exchange 4 | 5 | - 6 | - 7 | 8 | ## OpenSky 9 | 10 | - 11 | - 12 | 13 | ## GeoPy - Location Name Lookup 14 | 15 | - 16 | - 17 | 18 | ## Colorama 19 | 20 | - 21 | 22 | ## Google Static Maps 23 | 24 | - 25 | 26 | ## Twitter Tutorial 27 | 28 | - 29 | 30 | ## Pushbullet 31 | 32 | - 33 | 34 | ## Discord Webhooks 35 | 36 | - 37 | - 38 | 39 | ## Selenium - ChromeDriver, Screenshot ADSBX 40 | 41 | - 42 | - 43 | - 44 | - 45 | - 46 | - 47 | - 48 | - 49 | 50 | ## Web Driver Manager 51 | 52 | 53 | 54 | ## Tabulate 55 | 56 | - 57 | 58 | ## Nearest Airport 59 | 60 | - 61 | 62 | ### OpenFlights / airports.dat 63 | 64 | - 65 | 66 | ### OurAirports / airports.csv / regions.csv 67 | 68 | - 69 | 70 | ### Telegram Bot 71 | 72 | - -------------------------------------------------------------------------------- /meta_toolkit.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | def post_fb(page_id, file_path, message, access_token): 4 | """Posts to Facebook with Image""" 5 | import os 6 | file_name = os.path.basename(file_path) 7 | files= {'image':(file_name, open(file_path, 'rb'), "multipart/form-data")} 8 | url = f"https://graph.facebook.com/{page_id}/photos?message={message}&access_token={access_token}" 9 | resp = requests.post(url, files=files) 10 | resp.raise_for_status() 11 | print("Facebook Post Response: ", resp.json()) 12 | return resp.json() 13 | 14 | def get_fb_post_image_link(post_id, access_token): 15 | """Returns Highest Resolution image link of a Facebook Post by FBID""" 16 | url = f"https://graph.facebook.com/{post_id}?fields=images&access_token={access_token}" 17 | resp = requests.get(url) 18 | resp.raise_for_status() 19 | image_url = resp.json()['images'][0]['source'] 20 | print("Highest Resoulution Image URL for FBID", post_id, "is", image_url) 21 | return image_url 22 | 23 | def post_to_instagram(ig_user_id, access_token, image_url, caption): 24 | """Posts to Instagram""" 25 | post_url = f'https://graph.facebook.com/v13.0/{ig_user_id}/media' 26 | payload = { 27 | 'caption': caption, 28 | 'access_token': access_token, 29 | 'image_url': image_url 30 | } 31 | resp = requests.post(post_url, data=payload) 32 | resp.raise_for_status() 33 | print("IG Media Response:", resp.json()) 34 | result = json.loads(resp.text) 35 | if 'id' in result: 36 | creation_id = result['id'] 37 | second_url = f'https://graph.facebook.com/v13.0/{ig_user_id}/media_publish' 38 | second_payload = { 39 | 'creation_id': creation_id, 40 | 'access_token':access_token 41 | } 42 | resp = requests.post(second_url, data=second_payload) 43 | resp.raise_for_status() 44 | print('Posted to Instagram', caption, "IG response:", resp.json()) 45 | else: 46 | print('Could not post to Instagram: ', resp.json()) 47 | def post_to_meta_both(fb_page_id, ig_user_id, file_path, message, access_token): 48 | """Posts to Facebook and Instagram""" 49 | post_info = post_fb(fb_page_id, file_path, message, access_token) 50 | fb_image_link = get_fb_post_image_link(post_info['id'], access_token) 51 | post_to_instagram(ig_user_id, access_token, fb_image_link, message) 52 | -------------------------------------------------------------------------------- /fuel_calc.py: -------------------------------------------------------------------------------- 1 | import json 2 | import requests 3 | def get_avg_fuel_price(): 4 | import pandas as pd 5 | from bs4 import BeautifulSoup 6 | try: 7 | response = requests.get("https://www.airnav.com/fuel/report.html") 8 | soup = BeautifulSoup(response.text, 'lxml') # Parse the HTML as a string 9 | table = soup.find_all('table')[3] # Grab the first table 10 | nation_wide = table.find_all('tr')[4] 11 | nation_wide_avg_jeta = nation_wide.find_all('td')[6] 12 | print("Current nationwide Jet-A fuel price avg per G is $", nation_wide_avg_jeta.text[1:]) 13 | return(float(nation_wide_avg_jeta.text[1:])) 14 | except Exception as e: 15 | print(e) 16 | return None 17 | 18 | def fuel_calculation(aircraft_icao_type, minutes): 19 | """Calculates fuel usage, price, c02 output of a flight depending on aircraft type and flight length""" 20 | with open("aircraft_type_fuel_consumption_rates.json", "r") as f: 21 | fuellist = json.loads(f.read()) 22 | fuel_flight_info = {} 23 | if aircraft_icao_type in fuellist.keys(): 24 | avg_fuel_price_per_gallon = get_avg_fuel_price() 25 | galph = fuellist[aircraft_icao_type]["galph"] 26 | fuel_used_gal = galph * (minutes/60) 27 | fuel_flight_info["fuel_price"] = round(fuel_used_gal * avg_fuel_price_per_gallon) 28 | fuel_used_kg = fuel_used_gal * 3.04 29 | c02_tons = (fuel_used_kg * 3.15 ) / 907.185 30 | fuel_flight_info['fuel_used_kg'] = round(fuel_used_kg) 31 | fuel_flight_info["fuel_used_gal"] = round(fuel_used_gal) 32 | fuel_flight_info['fuel_used_lters'] = round(fuel_used_gal*3.78541) 33 | fuel_flight_info["fuel_used_lbs"] = round(fuel_used_kg * 2.20462) 34 | fuel_flight_info["c02_tons"] = round(c02_tons) if c02_tons > 1 else round(c02_tons, 4) 35 | print ("Fuel info", fuel_flight_info) 36 | return fuel_flight_info 37 | else: 38 | print("Can't calculate fuel info unknown aircraft ICAO type") 39 | return None 40 | 41 | def fuel_message(fuel_info): 42 | cost = "{:,}".format(fuel_info['fuel_price']) 43 | gallons = "{:,}".format(fuel_info['fuel_used_gal']) 44 | lters = "{:,}".format(fuel_info['fuel_used_lters']) 45 | lbs = "{:,}".format(fuel_info['fuel_used_lbs']) 46 | kgs = "{:,}".format(fuel_info['fuel_used_kg']) 47 | fuel_message = f"\n~ {gallons} gallons ({lters} liters). \n~ {lbs} lbs ({kgs} kg) of jet fuel used. \n~ ${cost} cost of fuel. \n~ {fuel_info['c02_tons']} tons of CO2 emissions." 48 | print(fuel_message) 49 | return fuel_message 50 | -------------------------------------------------------------------------------- /modify_image.py: -------------------------------------------------------------------------------- 1 | def append_airport(filename, airport, text_credit=None): 2 | from PIL import Image, ImageDraw, ImageFont 3 | distance_mi = airport['distance_mi'] 4 | icao = airport['icao'] 5 | iata = airport['iata_code'] 6 | distance_km = distance_mi * 1.609 7 | 8 | # create Image object with the input image 9 | image = Image.open(filename) 10 | # initialise the drawing context with 11 | # the image object as background 12 | draw = ImageDraw.Draw(image) 13 | 14 | #Setup fonts 15 | fontfile = "./dependencies/Roboto-Regular.ttf" 16 | font = ImageFont.truetype(fontfile, 14) 17 | mini_font = ImageFont.truetype(fontfile, 12) 18 | head_font = ImageFont.truetype(fontfile, 16) 19 | 20 | #Setup Colors 21 | black = 'rgb(0, 0, 0)' # Black 22 | white = 'rgb(255, 255, 255)' # White 23 | navish = 'rgb(0, 63, 75)' 24 | whitish = 'rgb(248, 248, 248)' 25 | #Info Box 26 | draw.rectangle(((325, 760), (624, 800)), fill= white, outline=black) 27 | #Header Box 28 | draw.rectangle(((401, 738), (549, 760)), fill= navish) 29 | #Create Text 30 | #ADSBX Credit 31 | if text_credit is not None: 32 | draw.rectangle(((658, 762), (800, 782)), fill= white) 33 | (x, y) = (660, 760) 34 | text = text_credit 35 | draw.text((x, y), text, fill=black, font=head_font) 36 | #Nearest Airport Header 37 | (x, y) = (422, 740) 38 | text = "Nearest Airport" 39 | draw.text((x, y), text, fill=white, font=head_font) 40 | #ICAO | IATA 41 | (x, y) = (330, 765) 42 | if airport['iata_code'] != '' and airport['icao'] != '': 43 | airport_codes = airport['iata_code'] + " / " + airport['icao'] 44 | elif airport['icao'] != '': 45 | airport_codes = airport['icao'] 46 | else: 47 | airport_codes = airport['ident'] 48 | draw.text((x, y), airport_codes, fill=black, font=font) 49 | #Distance 50 | (x, y) = (460, 765) 51 | text = str(round(distance_mi, 2)) + "mi / " + str(round(distance_km, 2)) + "km away" 52 | draw.text((x, y), text, fill=black, font=font) 53 | #Full name 54 | (x, y) = (330, 783) 55 | MAX_WIDTH = 325 56 | if font.getsize(airport['name'])[0] <= MAX_WIDTH: 57 | text = airport['name'] 58 | else: 59 | text = "" 60 | for char in airport['name']: 61 | if font.getsize(text)[0] >= (MAX_WIDTH - 10): 62 | text += "..." 63 | break 64 | else: 65 | text += char 66 | 67 | 68 | draw.text((x, y), text, fill=black, font=mini_font) 69 | image.show() 70 | # save the edited image 71 | image.save(filename) -------------------------------------------------------------------------------- /defADSBX.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | import configparser 4 | from datetime import datetime 5 | from http.client import IncompleteRead 6 | import http.client as http 7 | import urllib3 8 | import socket 9 | main_config = configparser.ConfigParser() 10 | main_config.read('./configs/mainconf.ini') 11 | api_version = main_config.get('ADSBX', 'API_VERSION') 12 | 13 | def pull(url, headers): 14 | try: 15 | response = requests.get(url, headers = headers, timeout=30) 16 | print ("HTTP Status Code:", response.status_code) 17 | response.raise_for_status() 18 | except (requests.HTTPError, ConnectionError, requests.Timeout, urllib3.exceptions.ConnectionError) as error_message: 19 | print("Basic Connection Error") 20 | print(error_message) 21 | response = None 22 | except (requests.RequestException, IncompleteRead, ValueError, socket.timeout, socket.gaierror) as error_message: 23 | print("Connection Error") 24 | print(error_message) 25 | response = None 26 | except Exception as error_message: 27 | print("Connection Error uncaught, basic exception for all") 28 | print(error_message) 29 | response = None 30 | return response 31 | 32 | def pull_adsbx(planes): 33 | api_version = int(main_config.get('ADSBX', 'API_VERSION')) 34 | if api_version not in [1, 2]: 35 | raise ValueError("Bad ADSBX API Version") 36 | if main_config.getboolean('ADSBX', 'ENABLE_PROXY') is False: 37 | if api_version == 1: 38 | if len(planes) > 1: 39 | url = "https://adsbexchange.com/api/aircraft/json/" 40 | elif len(planes) == 1: 41 | url = "https://adsbexchange.com/api/aircraft/icao/" + str(list(planes.keys())[0]) + "/" 42 | elif api_version == 2: 43 | url = "https://adsbexchange.com/api/aircraft/v2/all" 44 | else: 45 | if main_config.has_option('ADSBX', 'PROXY_HOST'): 46 | if api_version == 1: 47 | url = main_config.get('ADSBX', 'PROXY_HOST') + "/api/aircraft/json/all" 48 | if api_version == 2: 49 | url = main_config.get('ADSBX', 'PROXY_HOST') + "/api/aircraft/v2/all" 50 | else: 51 | raise ValueError("Proxy enabled but no host") 52 | headers = { 53 | 'api-auth': main_config.get('ADSBX', 'API_KEY'), 54 | 'Accept-Encoding': 'gzip' 55 | } 56 | response = pull(url, headers) 57 | if response is not None: 58 | try: 59 | data = json.loads(response.text) 60 | except (json.decoder.JSONDecodeError, ValueError) as error_message: 61 | print("Error with JSON") 62 | print(error_message) 63 | data = None 64 | except TypeError as error_message: 65 | print("Type Error", error_message) 66 | data = None 67 | else: 68 | if "msg" in data.keys() and data['msg'] != "No error": 69 | raise ValueError("Error from ADSBX: msg = ", data['msg']) 70 | if "ctime" in data.keys(): 71 | data_ctime = float(data['ctime']) / 1000.0 72 | print("Data ctime:",datetime.utcfromtimestamp(data_ctime)) 73 | if "now" in data.keys(): 74 | data_now = float(data['now']) / 1000.0 75 | print("Data now time:",datetime.utcfromtimestamp(data_now)) 76 | print("Current UTC:", datetime.utcnow()) 77 | else: 78 | data = None 79 | return data 80 | 81 | def pull_date_ras(date): 82 | url = f"https://globe.adsbexchange.com/globe_history/{date}/acas/acas.json" 83 | headers = { 84 | 'Accept-Encoding': 'gzip' 85 | } 86 | response = pull(url, headers) 87 | if response is not None: 88 | data = response.text.splitlines() 89 | else: 90 | data = None 91 | return data -------------------------------------------------------------------------------- /defTelegram.py: -------------------------------------------------------------------------------- 1 | def sendTeleg(photo, message, config): 2 | try: 3 | from telegram import __version_info__ 4 | except ImportError: 5 | __version_info__ = (0, 0, 0, 0, 0) 6 | if __version_info__ < (20, 0, 0, "alpha", 5): 7 | sent = sendTelegOld(photo, message, config) 8 | return sent 9 | else: 10 | import asyncio 11 | sent = asyncio.run(t_send_photo(photo,message,config)) 12 | return sent 13 | 14 | def sendTelegOld(photo, message, config): 15 | import telegram 16 | sent = False 17 | retry_c = 0 18 | while sent == False: 19 | try: 20 | bot = telegram.Bot(token=config.get('TELEGRAM', 'BOT_TOKEN'), request=telegram.utils.request.Request(connect_timeout=20, read_timeout=20)) 21 | sent = bot.send_photo(chat_id=config.get('TELEGRAM', 'ROOM_ID'), photo=photo, caption=message, parse_mode=telegram.ParseMode.MARKDOWN, timeout=20) 22 | except Exception as err: 23 | print('err.args:') 24 | print(err.args) 25 | print(f"Unexpected {err=}, {type(err)=}") 26 | print("\nString err:\n"+str(err)) 27 | if retry_c > 4: 28 | print('Telegram attempts exceeded. Message not sent.') 29 | break 30 | elif str(err) == 'Unauthorized': 31 | print('Invalid Telegram bot token, message not sent.') 32 | break 33 | elif str(err) == 'Timed out': 34 | retry_c += 1 35 | print('Telegram timeout count: '+str(retry_c)) 36 | pass 37 | elif str(err) == 'Chat not found': 38 | print('Invalid Telegram Chat ID, message not sent.') 39 | break 40 | elif str(err)[:35] == '[Errno 2] No such file or directory': 41 | print('Telegram module couldn\'t find an image to sent.') 42 | break 43 | elif str(err) == 'Media_caption_too_long': 44 | print('Telegram image caption length exceeds 1024 characters. Message not sent.') 45 | break 46 | else: 47 | print('[X] Unknown Telegram error. Message not sent.') 48 | break 49 | else: 50 | print("Telegram message successfully sent.") 51 | return sent 52 | 53 | async def t_send_photo(photo,message,config): 54 | import telegram 55 | sent = False 56 | retry_c = 0 57 | while sent == False: 58 | try: 59 | bot = telegram.Bot(token=config.get('TELEGRAM', 'BOT_TOKEN')) 60 | sent = await bot.send_photo(chat_id=config.get('TELEGRAM', 'ROOM_ID'), photo=photo, caption=message) 61 | except Exception as err: 62 | print('err.args:') 63 | print(err.args) 64 | print(f"Unexpected {err=}, {type(err)=}") 65 | print("\nString err:\n"+str(err)) 66 | if retry_c > 4: 67 | print('Telegram attempts exceeded. Message not sent.') 68 | break 69 | elif str(err) == 'Unauthorized': 70 | print('Invalid Telegram bot token, message not sent.') 71 | break 72 | elif str(err) == 'Timed out': 73 | retry_c += 1 74 | print('Telegram timeout count: '+str(retry_c)) 75 | pass 76 | elif str(err) == 'Chat not found': 77 | print('Invalid Telegram Chat ID, message not sent.') 78 | break 79 | elif str(err)[:35] == '[Errno 2] No such file or directory': 80 | print('Telegram module couldn\'t find an image to send.') 81 | break 82 | elif str(err) == 'Media_caption_too_long': 83 | print('Telegram image caption length exceeds 1024 characters. Message not sent.') 84 | break 85 | else: 86 | print('[X] Unknown Telegram error. Message not sent.') 87 | break 88 | else: 89 | print("Telegram message successfully sent.") 90 | return sent 91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # plane-notify 2 | 3 | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/c4e1d839eec3468cadfe351d64dc1ac4)](https://app.codacy.com/manual/Jxck-S/plane-notify?utm_source=github.com&utm_medium=referral&utm_content=Jxck-S/plane-notify&utm_campaign=Badge_Grade_Settings) 4 | [![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)](https://opensource.org/licenses/) 5 | 6 | Notify if configured planes have taken off or landed using Python with OpenSky(free) or ADSBExchange Data(paid, declining data, and run by clowns), outputs location of takeoff location of landing and takeoff by reverse lookup of coordinates. 7 | 8 | ### Discord Output Example 9 | 10 | ![Discord Output Example](./ExImages/DiscordEX2.png?raw=true) 11 | 12 | #### More examples are in the ExImages folder 13 | 14 | [ExImages](./ExImages) 15 | 16 | ### Background 17 | 18 | I made this program so I could track Elon Musk's Jet and share his whereabouts with others orginally on Twitter (but now suspended, but now also on other platforms). I have now expanded and run multiple accounts for multiple planes, a list of the accounts can be found here 19 | 20 | ### Contributing 21 | 22 | I'm open to any help or suggestions, I realize there are many better ways to improve this program and better ways to get this program to work properly, I'm only a noob. I'll accept pull requests. If you'd like to discuss join 23 | 24 | ### [Algorithm](PseudoCode.md) 25 | 26 | ## Setup / Install 27 | - Install using the following steps or use Docker, scroll down to the Docker section. 28 | 29 | ### Make sure Python/PIP is installed 30 | 31 | ```bash 32 | apt update 33 | apt install python3 34 | apt install python3-pip 35 | ``` 36 | 37 | ### Install Pipenv and Dependencies 38 | 39 | ```bash 40 | pip install pipenv 41 | pipenv install 42 | ``` 43 | 44 | ### Install Selenium / ChromeDriver or setup Google Static Maps 45 | 46 | Selenium/ChromeDriver is used to take a screenshot of the plane on globe.theairtraffic.com. Or use Google Static Maps, which can cost money if overused(No tutorial use to get to a key). 47 | 48 | #### Chrome 49 | - This is assuming linux/debian 50 | ```bash 51 | curl -sSL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add 52 | echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list 53 | apt update 54 | apt install google-chrome-stable 55 | ``` 56 | These output methods once installed can be configured in the planes config you create, using the example plane1.ini 57 | 58 | ### Install Screen to run in the background 59 | 60 | ```bash 61 | apt install screen 62 | ``` 63 | 64 | ### Download / Clone 65 | 66 | ```bash 67 | apt install git 68 | git clone -b multi --single-branch https://github.com/Jxck-S/plane-notify.git 69 | cd plane-notify 70 | ``` 71 | 72 | ### Configure main config file with keys and URLs (mainconf.ini) in the configs directory 73 | 74 | - Copy `mainconf.ini.example` to `mainconf.ini` andCopy `plane1.ini.example` to `plane1.ini`. `plane1.ini` can change names as long as it ends with the ini extension 75 | - Edit them with nano or vi on the running machine or on your pc and transfer the config to where you will be running the bot 76 | - Pick between OpenSky and ADS-B Exchange 77 | - The OpenSky API is free for everyone but the data is not as good as ADS-B Exchange. The ADS-B Exchange API is not free and this program will not work for the Rapid API from ADS-B Exchange. It only works with the API that they give when you have a partnership with ADS-B Exchange. It is not cheap to get the ADS-B Exchange full API, Don't contact them unless you are ready to pay. 78 | - If you'd like to add support for ADS-B Exchanges RapidAPI feel free to work on it and submit a merge request. 79 | - If you've set up multiple planes and want to use ADSB Exchange as your source you must have /all endpoint access to their API or it won't work. 80 | - Pick the correct API version for ADS-B Exchange. 81 | - Proxy is if your running multiple programs that use the ADSB Exchange, setup the proxy from lemonodor so you don't abuse the ADSB Exchange API, otherwise leave enable false. 82 | - When using OpenSky there are more bugs because I mainly use ADS-B Exchange and work less on the OpenSky Implementation. 83 | 84 | 85 | ### Configure individual planes 86 | 87 | - An example file is given (plane1.ini) plane config files should be in the configs directory, the program looks for any file in that folder with a .ini extension. 88 | - Each plane should have its own config 89 | 90 | ### Enter and create a new Screen Session 91 | 92 | ```bash 93 | screen -R 94 | ``` 95 | 96 | ### Start Program 97 | 98 | ```bash 99 | pipenv run python __main__.py 100 | ``` 101 | 102 | ## Using with Docker 103 | 104 | Install [docker from their website](https://docs.docker.com/get-docker/). Run the following command from the root of the project. 105 | 106 | ```bash 107 | docker-compose up -d 108 | ``` 109 | 110 | After running this command, due to the `-d` flag the container will be running in the background. To see the logs of the docker container use `docker logs CONTAINER` (add `-f` to continue streaming the containers output) 111 | 112 | ### Telegram message feature - march/2022 113 | 114 | Data obtained can be sent through Telegram to a chat (contact), channel or groups. 115 | 116 | Creating a Telegram Bot 117 | - Start a conversation with [BotFather](https://t.me/BotFather); 118 | - Send it to the BotFather: /newbot 119 | - Choose a name for your bot; 120 | - Choose a username for your bot; 121 | - Done! You'll get a token to access the HTTP API. 122 | 123 | Getting channel or chat (contact) ID 124 | - Start a conversation with [JsonDumpBot](https://t.me/JsonDumpBot); 125 | - It will reply with a json with information from the message; 126 | - Go to the channel or chat you want the id and forward a message from there to JsonDumpBot; 127 | - Find the id in the reply. It'll look something like this: 128 | ```bash 129 | {... 130 | "forward_from_chat": { 131 | "id": xxxxxxxxx, 132 | ...} 133 | ``` 134 | - Don't forget to add the bot as admin in channel so messages can be sent. 135 | 136 | Getting a group ID 137 | - Open [Telegram web](https://web.telegram.org); 138 | - Go to group and check the url on address bar of browser; 139 | - That's the group ID (-xxxxxxxxx), it'll look something like this: 140 | ```bash 141 | https://web.telegram.org/z/#-xxxxxxxxx 142 | ``` 143 | 144 | ### TODO 145 | 146 | - General Cleanup 147 | - Restructure project to make it proper currently random files because I didn't know how to properly structure a project before. (in progress) 148 | - Add proper logging and service to run the program and remove excessive printing. 149 | - Better single config YAML, or DB maybe 150 | 151 | ### [More References/Documentation](References.md) 152 | -------------------------------------------------------------------------------- /defSS.py: -------------------------------------------------------------------------------- 1 | import json 2 | from selenium import webdriver 3 | from selenium.webdriver.chrome.service import Service 4 | from webdriver_manager.chrome import ChromeDriverManager 5 | import time 6 | from selenium.webdriver.support.ui import WebDriverWait 7 | from selenium.webdriver.common.by import By 8 | from selenium.common.exceptions import NoSuchElementException 9 | def blur_elements_by_id(browser, element_ids): 10 | for element in element_ids: 11 | try: 12 | element = browser.find_element(By.ID, element) 13 | browser.execute_script("arguments[0].style.filter = 'blur(7px)';", element) 14 | except NoSuchElementException: 15 | print("Issue finding:", element, "on page") 16 | def get_adsbx_screenshot(file_path, url_params, enable_labels=False, enable_track_labels=False, overrides={}, conceal_ac_id=False, conceal_pia=False): 17 | import os 18 | import platform 19 | chrome_options = webdriver.ChromeOptions() 20 | chrome_options.headless = True 21 | chrome_options.add_argument('window-size=800,800') 22 | chrome_options.add_argument('ignore-certificate-errors') 23 | chrome_options.add_experimental_option('excludeSwitches', ['enable-logging']) 24 | if platform.system() == "Linux": 25 | chrome_options.add_argument('crash-dumps-dir=/tmp/plane-notify/chrome') 26 | 27 | #Plane images issue loading when in headless setting agent fixes. 28 | chrome_options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36") 29 | if platform.system() == "Linux" and os.geteuid()==0: 30 | chrome_options.add_argument('--no-sandbox') # required when running as root user. otherwise you would get no sandbox errors. 31 | browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options) 32 | url = f"https://globe.theairtraffic.com/?{url_params}" 33 | print(f"Getting Screenshot of {url}") 34 | browser.set_page_load_timeout(80) 35 | browser.get(url) 36 | WebDriverWait(browser, 40).until(lambda d: d.execute_script("return jQuery.active == 0")) 37 | remove_id_elements = ["show_trace", "credits", 'infoblock_close', 'selected_photo_link', "history_collapse"] 38 | for element in remove_id_elements: 39 | try: 40 | element = browser.find_element(By.ID, element) 41 | browser.execute_script("""var element = arguments[0]; element.parentNode.removeChild(element); """, element) 42 | except: 43 | print("Issue finding:", element, "on page") 44 | #Remove watermark on data 45 | try: 46 | browser.execute_script("document.getElementById('selected_infoblock').className = 'none';") 47 | except: 48 | print("Couldn't remove watermark from map") 49 | #Disable slidebar 50 | try: 51 | browser.execute_script("$('#infoblock-container').css('overflow', 'hidden');") 52 | except: 53 | print("Couldn't disable sidebar on map") 54 | #Remove Google Ads 55 | try: 56 | element = browser.find_element(By.XPATH, "//*[contains(@id, 'FIOnDemandWrapper_')]") 57 | browser.execute_script("""var element = arguments[0]; element.parentNode.removeChild(element); """, element) 58 | except: 59 | print("Couldn't remove Google Ads") 60 | #Remove Copy Link 61 | try: 62 | element = browser.find_element(By.XPATH, "//*[@id='selected_icao']/span[2]/a") 63 | browser.execute_script("""var element = arguments[0]; element.parentNode.removeChild(element); """, element) 64 | except Exception as e: 65 | print("Couldn't remove copy link button from map", e) 66 | #browser.execute_script("toggleFollow()") 67 | if conceal_pia or conceal_ac_id: 68 | blur_elements_by_id(browser, ["selected_callsign", "selected_icao", "selected_squawk1"]) 69 | if conceal_ac_id: 70 | blur_elements_by_id(browser, ["selected_registration", "selected_country", "selected_dbFlags", "selected_ownop", "selected_typelong", "selected_icaotype", "airplanePhoto", "silhouette", "copyrightInfo"]) 71 | if enable_labels: 72 | browser.find_element(By.TAG_NAME, 'body').send_keys('l') 73 | if enable_track_labels: 74 | browser.find_element(By.TAG_NAME, 'body').send_keys('k') 75 | from selenium.webdriver.support import expected_conditions as EC 76 | time.sleep(15) 77 | 78 | if 'reg' in overrides.keys(): 79 | element = browser.find_element(By.ID, "selected_registration") 80 | browser.execute_script(f"arguments[0].innerText = '* {overrides['reg']}'", element) 81 | reg = overrides['reg'] 82 | else: 83 | try: 84 | reg = browser.find_element(By.ID, "selected_registration").get_attribute("innerHTML") 85 | print("Reg from tar1090 is", reg) 86 | except Exception as e: 87 | print("Couldn't find reg in tar1090", e) 88 | reg = None 89 | if reg is not None: 90 | try: 91 | try: 92 | photo_box = browser.find_element(By.ID, "silhouette") 93 | except NoSuchElementException: 94 | photo_box = browser.find_element(By.ID, "airplanePhoto") 95 | finally: 96 | import requests, json 97 | photo_list = json.loads(requests.get("https://raw.githubusercontent.com/Jxck-S/aircraft-photos/main/photo-list.json", timeout=20).text) 98 | if reg in photo_list.keys(): 99 | browser.execute_script("arguments[0].id = 'airplanePhoto';", photo_box) 100 | browser.execute_script("arguments[0].removeAttribute('width')", photo_box) 101 | browser.execute_script("arguments[0].style.width = '200px';", photo_box) 102 | browser.execute_script("arguments[0].style.float = 'left';", photo_box) 103 | browser.execute_script(f"arguments[0].src = 'https://raw.githubusercontent.com/Jxck-S/aircraft-photos/main/images/{reg}.jpg';", photo_box) 104 | image_copy_right = browser.find_element(By.ID, "copyrightInfo") 105 | browser.execute_cdp_cmd('Emulation.setScriptExecutionDisabled', {'value': True}) 106 | copy_right_children = image_copy_right.find_elements(By.XPATH, "*") 107 | if len(copy_right_children) > 0: 108 | browser.execute_script(f"arguments[0].innerText = 'Image © {photo_list[reg]['photographer']}'", copy_right_children[0]) 109 | else: 110 | browser.execute_script(f"arguments[0].appendChild(document.createTextNode('Image © {photo_list[reg]['photographer']}'))", image_copy_right) 111 | except Exception as e: 112 | print("Error on changing photo", e) 113 | if 'type' in overrides.keys(): 114 | element = browser.find_element(By.ID, "selected_icaotype") 115 | browser.execute_script(f"arguments[0].innerText = '* {overrides['type']}'", element) 116 | if 'typelong' in overrides.keys(): 117 | element = browser.find_element(By.ID, "selected_typelong") 118 | browser.execute_script(f"arguments[0].innerText = '* {overrides['typelong']}'", element) 119 | if 'ownop' in overrides.keys(): 120 | element = browser.find_element(By.ID, "selected_ownop") 121 | browser.execute_script(f"arguments[0].innerText = '* {overrides['ownop']}'", element) 122 | time.sleep(5) 123 | browser.save_screenshot(file_path) 124 | browser.quit() 125 | def generate_adsbx_screenshot_time_params(timestamp): 126 | from datetime import datetime 127 | from datetime import timedelta 128 | timestamp_dt = datetime.utcfromtimestamp(timestamp) 129 | print(timestamp_dt) 130 | start_time = timestamp_dt - timedelta(minutes=1) 131 | time_params = "&showTrace=" + timestamp_dt.strftime("%Y-%m-%d") + "&startTime=" + start_time.strftime("%H:%M:%S") + "&endTime=" + timestamp_dt.strftime("%H:%M:%S") 132 | return time_params 133 | -------------------------------------------------------------------------------- /aircraft_type_fuel_consumption_rates.json: -------------------------------------------------------------------------------- 1 | { 2 | "EA50": { 3 | "name": "Eclipse 550", 4 | "galph": 76, 5 | "category": "VLJ" 6 | }, 7 | "LJ31": { 8 | "name": "Learjet 31", 9 | "galph": 202, 10 | "category": "Light" 11 | }, 12 | "LJ40": { 13 | "name": "Learjet 40", 14 | "galph": 207, 15 | "category": "Light" 16 | }, 17 | "PC24": { 18 | "name": "Pilatus PC-24", 19 | "galph": 154, 20 | "category": "Light" 21 | }, 22 | "LJ45": { 23 | "name": "Learjet 45", 24 | "galph": 205, 25 | "category": "Super Light" 26 | }, 27 | "LJ70": { 28 | "name": "Learjet 70", 29 | "galph": 198, 30 | "category": "Super Light" 31 | }, 32 | "LJ75": { 33 | "name": "Learjet 75", 34 | "galph": 199, 35 | "category": "Super Light" 36 | }, 37 | "G150": { 38 | "name": "Gulfstream G150", 39 | "galph": 228, 40 | "category": "Midsize" 41 | }, 42 | "LJ60": { 43 | "name": "Learjet 60", 44 | "galph": 239, 45 | "category": "Midsize" 46 | }, 47 | "GALX": { 48 | "name": "Gulfstream G200", 49 | "galph": 278, 50 | "category": "Super Midsize" 51 | }, 52 | "G280": { 53 | "name": "Gulfstream G280", 54 | "galph": 297, 55 | "category": "Super Midsize" 56 | }, 57 | "GLF5": { 58 | "name": "Gulfstream G500", 59 | "galph": 447, 60 | "category": "Large" 61 | }, 62 | "GLF6": { 63 | "name": "Gulfstream G650", 64 | "galph": 503, 65 | "category": "Ultra Long Range" 66 | }, 67 | "PC12": { 68 | "name": "Pilatus PC-12", 69 | "galph": 66, 70 | "category": "Turboprop Aircraft" 71 | }, 72 | "GLEX": { 73 | "name": "Global", 74 | "galph": 500, 75 | "category": "Ultra Long Range" 76 | }, 77 | "CL30": { 78 | "name": "Challenger 300", 79 | "galph": 295, 80 | "category": "Super Midsize" 81 | }, 82 | "B742": { 83 | "name": "Boeing 747-200", 84 | "galph": 3830, 85 | "category": "Large" 86 | }, 87 | "T38": { 88 | "name": "T-38 Talon", 89 | "galph": 375, 90 | "category": "Fighter" 91 | }, 92 | "WB57": { 93 | "name": "Martin B-57 Canberra", 94 | "galph": 531, 95 | "category": "Twinjet Tactical Bomber and Reconnaissance" 96 | }, 97 | "B74S": { 98 | "name": "747 SP", 99 | "galph": 2289, 100 | "category": "Large" 101 | }, 102 | "B752": { 103 | "name": "757 200", 104 | "galph": 877, 105 | "category": "Large" 106 | }, 107 | "B738": { 108 | "name": "737 800", 109 | "galph": 832, 110 | "category": "Medium" 111 | }, 112 | "B737": { 113 | "name": "737 700", 114 | "galph": 796, 115 | "category": "Medium" 116 | }, 117 | "A320": { 118 | "name": "A320", 119 | "galph": 800, 120 | "category": "Medium" 121 | }, 122 | "P3": { 123 | "name": "Lockheed Orion P3", 124 | "galph": 671, 125 | "category": "Turboprop" 126 | }, 127 | "C750": { 128 | "name": "Cessna 750 Citation X", 129 | "galph": 347, 130 | "category": "Small Private Jet" 131 | }, 132 | "FA7X": { 133 | "name": "Dassult Falcon 7X", 134 | "galph": 380, 135 | "category": "Small Private Jet" 136 | }, 137 | "F900": { 138 | "name": "Dassult Falcon 900", 139 | "galph": 347, 140 | "category": "Small Private Jet" 141 | }, 142 | "H25B": { 143 | "name": "Hawker 750/850", 144 | "galph": 270, 145 | "category": "Small Private Jet" 146 | }, 147 | "C680": { 148 | "name": "Cessna 680 Citation", 149 | "galph": 247, 150 | "category": "Small Private Jet" 151 | }, 152 | "GLF3": { 153 | "name": "Gulfstream 3", 154 | "galph": 568, 155 | "category": "Heavy Private Jet" 156 | }, 157 | "GLF4": { 158 | "name": "Gulfstream 4", 159 | "galph": 479, 160 | "category": "Heavy Private Jet" 161 | }, 162 | "CL60": { 163 | "name": "Bombardier CL-600 Challenge", 164 | "galph": 262, 165 | "category": "Mid-size Private Jet" 166 | }, 167 | "A139": { 168 | "name": "Agusta-Bell AW139", 169 | "galph": 150, 170 | "category": "Medium Utility Helicopter" 171 | }, 172 | "GL5T": { 173 | "name": "Global 5000", 174 | "galph": 455, 175 | "category": "Heavy Private Jet" 176 | }, 177 | "GA6C": { 178 | "name": "Gulfstream G600", 179 | "galph": 458, 180 | "category": "Heavy Private Jet" 181 | }, 182 | "A337": { 183 | "name": "Airbus Beluga XL", 184 | "galph": 1800, 185 | "category": "Large Transport Aircraft" 186 | }, 187 | "A3ST": { 188 | "name": "Airbus Beluga", 189 | "galph": 1260, 190 | "category": "Large Transport Aircraft" 191 | }, 192 | "F2TH": { 193 | "name": "Dassault Falcon 2000", 194 | "galph": 245, 195 | "category": "Medium Private Jet" 196 | }, 197 | "GA5C": { 198 | "name": "Gulfstream G500", 199 | "galph": 402, 200 | "category": "Large Private Jet" 201 | }, 202 | "C130": { 203 | "name": "Lockheed C130", 204 | "galph": 740, 205 | "category": "Medium Cargo" 206 | }, 207 | "B762": { 208 | "name": "Boeing 767 200", 209 | "galph": 1722, 210 | "category": "Wide-body" 211 | }, 212 | "B772": { 213 | "name": "Boeing 777 200", 214 | "galph": 2300, 215 | "category": "Wide-body" 216 | }, 217 | "SLCH": { 218 | "name": "Stratolaunch", 219 | "galph": 2396, 220 | "category": "Special" 221 | }, 222 | "P51": { 223 | "name": "P51 Mustang", 224 | "galph": 65, 225 | "category": "Fighter" 226 | }, 227 | "HDJT": { 228 | "name": "Honda Jet", 229 | "galph": 90, 230 | "category": "Light Jet" 231 | }, 232 | "B744": { 233 | "name": "Boeing 747-400", 234 | "galph": 3700, 235 | "category": "Heavy Airliner" 236 | }, 237 | "E190": { 238 | "name": "Embrar E190", 239 | "galph": 469, 240 | "category": "Heavy Jet" 241 | }, 242 | "FA50": { 243 | "name": "Falcon 50", 244 | "galph": 229, 245 | "category": "Heavy Jet" 246 | }, 247 | "GL7T": { 248 | "name": "Global 7000", 249 | "galph": 460, 250 | "category": "Heavy Jet" 251 | }, 252 | "GL6T": { 253 | "name": "", 254 | "galph": 455.0, 255 | "category": "" 256 | }, 257 | "C68A": { 258 | "name": "", 259 | "galph": 212.0, 260 | "category": "" 261 | }, 262 | "C56X": { 263 | "name": "", 264 | "galph": 217.0, 265 | "category": "" 266 | }, 267 | "B763": { 268 | "name": "", 269 | "galph": 1320.0, 270 | "category": "" 271 | }, 272 | "A310": { 273 | "name": "", 274 | "galph": 1189.0, 275 | "category": "" 276 | }, 277 | "A330": { 278 | "name": "", 279 | "galph": 1505.0, 280 | "category": "" 281 | }, 282 | "A380": { 283 | "name": "", 284 | "galph": 4062.0, 285 | "category": "" 286 | }, 287 | "E170": { 288 | "name": "", 289 | "galph": 469.0, 290 | "category": "" 291 | }, 292 | "DC87": { 293 | "name": "", 294 | "galph": 1250.0, 295 | "category": "" 296 | }, 297 | "SGUP": { 298 | "name": "", 299 | "galph": 1156.0, 300 | "category": "" 301 | }, 302 | "WHK2": { 303 | "name": "", 304 | "galph": 500.0, 305 | "category": "" 306 | }, 307 | "B350": { 308 | "name": "", 309 | "galph": 122.0, 310 | "category": "" 311 | }, 312 | "BE30": { 313 | "name": "", 314 | "galph": 121.0, 315 | "category": "" 316 | }, 317 | "FA8X": { 318 | "name": "", 319 | "galph": 380.0, 320 | "category": "" 321 | }, 322 | "E550": { 323 | "name": "", 324 | "galph": 280.0, 325 | "category": "" 326 | }, 327 | "E55P": { 328 | "name": "", 329 | "galph": 166.0, 330 | "category": "" 331 | }, 332 | "A332": { 333 | "name": "", 334 | "galph": 1480, 335 | "category": "" 336 | }, 337 | "GA7C": { 338 | "name": "", 339 | "galph": 382.0, 340 | "category": "" 341 | }, 342 | "FA6X": { 343 | "name": "", 344 | "galph": 419.0, 345 | "category": "" 346 | }, 347 | "B3XM": { 348 | "name": "", 349 | "galph": 716.0, 350 | "category": "" 351 | }, 352 | "B779": { 353 | "name": "", 354 | "galph": 2250.0, 355 | "category": "" 356 | }, 357 | "BE22": { 358 | "name": "", 359 | "galph": 60.0, 360 | "category": "" 361 | }, 362 | "C560": { 363 | "name": "", 364 | "galph": 182.0, 365 | "category": "" 366 | }, 367 | "E145": { 368 | "name": "", 369 | "galph": 284.0, 370 | "category": "" 371 | }, 372 | "C25C": { 373 | "name": "", 374 | "galph": 110.0, 375 | "category": "" 376 | }, 377 | "C25B": { 378 | "name": "", 379 | "galph": 110.0, 380 | "category": "" 381 | }, 382 | "C441": { 383 | "name": "", 384 | "galph": 57.0, 385 | "category": "" 386 | }, 387 | "E50P": { 388 | "name": "", 389 | "galph": 109.0, 390 | "category": "" 391 | }, 392 | "CRJ2": { 393 | "name": "", 394 | "galph": 325.0, 395 | "category": "" 396 | }, 397 | "CRJ7": { 398 | "name": "", 399 | "galph": 444.0, 400 | "category": "" 401 | }, 402 | "BE40": { 403 | "name": "", 404 | "galph": 220.0, 405 | "category": "" 406 | }, 407 | "C700": { 408 | "name": "", 409 | "galph": 288.0, 410 | "category": "" 411 | } 412 | } -------------------------------------------------------------------------------- /__main__.py: -------------------------------------------------------------------------------- 1 | import configparser 2 | import time 3 | from colorama import Fore, Back, Style 4 | import platform 5 | import traceback 6 | import os 7 | if platform.system() == "Windows": 8 | from colorama import init 9 | init(convert=True) 10 | elif platform.system() == "Linux": 11 | if os.path.exists("/tmp/plane-notify"): 12 | import shutil 13 | shutil.rmtree("/tmp/plane-notify") 14 | os.makedirs("/tmp/plane-notify") 15 | os.makedirs("/tmp/plane-notify/chrome") 16 | from planeClass import Plane 17 | from datetime import datetime 18 | import pytz 19 | import signal 20 | abspath = os.path.abspath(__file__) 21 | dname = os.path.dirname(abspath) 22 | os.chdir(dname) 23 | import sys 24 | sys.path.extend([os.getcwd()]) 25 | #Dependency Handling 26 | if not os.path.isdir("./dependencies/"): 27 | os.mkdir("./dependencies/") 28 | required_files = [ 29 | ("Roboto-Regular.ttf", 'https://github.com/googlefonts/roboto/blob/main/src/hinted/Roboto-Regular.ttf?raw=true'), 30 | ('airports.csv', 'https://ourairports.com/data/airports.csv'), 31 | ('regions.csv', 'https://ourairports.com/data/regions.csv'), 32 | ('Mictronics_db.zip', "https://www.mictronics.de/aircraft-database/indexedDB.php")] 33 | for file in required_files: 34 | file_name = file[0] 35 | url = file[1] 36 | if not os.path.isfile("./dependencies/" + file_name): 37 | print(f"{file_name} does not exist downloading now") 38 | try: 39 | import requests 40 | file_content = requests.get(url) 41 | 42 | open(("./dependencies/" + file_name), 'wb').write(file_content.content) 43 | except Exception as e: 44 | raise e("Error getting", file_name, "from", url) 45 | else: 46 | print(f"Successfully got {file_name}") 47 | else: 48 | print(f"Already have {file_name} continuing") 49 | if os.path.isfile("./dependencies/" + required_files[4][0]) and not os.path.isfile("./dependencies/aircrafts.json"): 50 | print("Extracting Mictronics DB") 51 | from zipfile import ZipFile 52 | with ZipFile("./dependencies/" + required_files[4][0], 'r') as mictronics_db: 53 | mictronics_db.extractall("./dependencies/") 54 | 55 | main_config = configparser.ConfigParser() 56 | print(os.getcwd()) 57 | main_config.read('./configs/mainconf.ini') 58 | source = main_config.get('DATA', 'SOURCE') 59 | if main_config.getboolean('DISCORD', 'ENABLE'): 60 | from defDiscord import sendDis 61 | role_id = main_config.get('DISCORD', 'ROLE_ID') if main_config.has_option('DISCORD', 'ROLE_ID') and main_config.get('DISCORD', 'ROLE_ID').strip() != "" else None 62 | sendDis("Started", main_config, role_id = main_config.get('DISCORD', 'ROLE_ID')) 63 | def service_exit(signum, frame): 64 | if main_config.getboolean('DISCORD', 'ENABLE'): 65 | from defDiscord import sendDis 66 | role_id = main_config.get('DISCORD', 'ROLE_ID') if main_config.has_option('DISCORD', 'ROLE_ID') and main_config.get('DISCORD', 'ROLE_ID').strip() != "" else None 67 | sendDis("Service Stop", main_config, role_id = role_id) 68 | raise SystemExit("Service Stop") 69 | signal.signal(signal.SIGTERM, service_exit) 70 | if os.path.isfile("lookup_route.py"): 71 | print("Route lookup is enabled") 72 | else: 73 | print("Route lookup is disabled") 74 | 75 | try: 76 | print(f"Source is set to {source}") 77 | import sys 78 | #Setup plane objects from plane configs 79 | planes = {} 80 | print("Found the following configs") 81 | for dirpath, dirname, filename in os.walk("./configs"): 82 | for filename in [f for f in filename if f.endswith(".ini") and f != "mainconf.ini"]: 83 | if "disabled" not in dirpath: 84 | print(os.path.join(dirpath, filename)) 85 | plane_config = configparser.ConfigParser() 86 | plane_config.read((os.path.join(dirpath, filename))) 87 | #Creates a Key labeled the ICAO of the plane, with the value being a plane object 88 | planes[plane_config.get('DATA', 'ICAO').upper()] = Plane(plane_config.get('DATA', 'ICAO'), os.path.join(dirpath, filename), plane_config) 89 | 90 | running_Count = 0 91 | failed_count = 0 92 | try: 93 | tz = pytz.timezone(main_config.get('DATA', 'TZ')) 94 | except pytz.exceptions.UnknownTimeZoneError: 95 | tz = pytz.UTC 96 | last_ra_count = None 97 | print(f"{len(planes)} Planes configured") 98 | while True: 99 | datetime_tz = datetime.now(tz) 100 | if datetime_tz.hour == 0 and datetime_tz.minute == 0: 101 | running_Count = 0 102 | running_Count +=1 103 | start_time = time.time() 104 | header = ("-------- " + str(running_Count) + " -------- " + str(datetime_tz.strftime("%I:%M:%S %p")) + " ---------------------------------------------------------------------------") 105 | print (f"{Back.GREEN} {Fore.BLACK} {header[0:100]} {Style.RESET_ALL}") 106 | if source == "ADSBX": 107 | #ACAS data 108 | from defADSBX import pull_date_ras 109 | import ast 110 | today = datetime.utcnow() 111 | date = today.strftime("%Y/%m/%d") 112 | ras = pull_date_ras(date) 113 | sorted_ras = {} 114 | if ras is not None: 115 | #Testing RAs 116 | #if last_ra_count is not None: 117 | # with open('./testing/acastest.json') as f: 118 | # data = f.readlines() 119 | # ras += data 120 | ra_count = len(ras) 121 | if last_ra_count is not None and ra_count != last_ra_count: 122 | print(abs(ra_count - last_ra_count), "new Resolution Advisories") 123 | for ra_num, ra in enumerate(ras[last_ra_count:]): 124 | ra = ast.literal_eval(ra) 125 | if ra['hex'].upper() in planes.keys(): 126 | if ra['hex'].upper() not in sorted_ras.keys(): 127 | sorted_ras[ra['hex'].upper()] = [ra] 128 | else: 129 | sorted_ras[ra['hex'].upper()].append(ra) 130 | else: 131 | print("No new Resolution Advisories") 132 | last_ra_count = ra_count 133 | for key, obj in planes.items(): 134 | if sorted_ras != {} and key in sorted_ras.keys(): 135 | print(f"{key} has {len(sorted_ras[key])} RAs") 136 | obj.check_new_ras(sorted_ras[key]) 137 | obj.expire_ra_types() 138 | #Normal API data 139 | api_version = int(main_config.get('ADSBX', 'API_VERSION')) 140 | if api_version == 2: 141 | icao_key = 'hex' 142 | elif api_version == 1: 143 | icao_key = 'icao' 144 | else: 145 | raise ValueError("Invalid API Version") 146 | from defADSBX import pull_adsbx 147 | data = pull_adsbx(planes) 148 | if data is not None: 149 | if data['ac'] is not None: 150 | data_indexed = {} 151 | for planeData in data['ac']: 152 | data_indexed[planeData[icao_key].upper()] = planeData 153 | for key, obj in planes.items(): 154 | try: 155 | if api_version == 1: 156 | obj.run_adsbx_v1(data_indexed[key.upper()]) 157 | elif api_version == 2: 158 | obj.run_adsbx_v2(data_indexed[key.upper()]) 159 | except KeyError: 160 | obj.run_empty() 161 | else: 162 | for obj in planes.values(): 163 | obj.run_empty() 164 | else: 165 | failed_count += 1 166 | elif source == "RpdADSBX": 167 | #ACAS data 168 | from defADSBX import pull_date_ras 169 | import ast 170 | today = datetime.utcnow() 171 | date = today.strftime("%Y/%m/%d") 172 | ras = pull_date_ras(date) 173 | sorted_ras = {} 174 | if ras is not None: 175 | #Testing RAs 176 | #if last_ra_count is not None: 177 | # with open('./testing/acastest.json') as f: 178 | # data = f.readlines() 179 | # ras += data 180 | ra_count = len(ras) 181 | if last_ra_count is not None and ra_count != last_ra_count: 182 | print(abs(ra_count - last_ra_count), "new Resolution Advisories") 183 | for ra_num, ra in enumerate(ras[last_ra_count:]): 184 | ra = ast.literal_eval(ra) 185 | if ra['hex'].upper() in planes.keys(): 186 | if ra['hex'].upper() not in sorted_ras.keys(): 187 | sorted_ras[ra['hex'].upper()] = [ra] 188 | else: 189 | sorted_ras[ra['hex'].upper()].append(ra) 190 | else: 191 | print("No new Resolution Advisories") 192 | last_ra_count = ra_count 193 | for key, obj in planes.items(): 194 | if sorted_ras != {} and key in sorted_ras.keys(): 195 | print(key, "has", len(sorted_ras[key]), "RAs") 196 | obj.check_new_ras(sorted_ras[key]) 197 | obj.expire_ra_types() 198 | from defRpdADSBX import pull_rpdadsbx 199 | data_indexed = {} 200 | for icao in planes: 201 | plane = planes[icao] 202 | plane_info = pull_rpdadsbx(icao) 203 | if plane_info: 204 | if plane_info['ac']: 205 | data_indexed[icao.upper()] = plane_info['ac'][0] 206 | plane.run_adsbx_v2(data_indexed[icao.upper()]) 207 | else: 208 | plane.run_empty() 209 | else: 210 | print(f"No data for icao {icao}. Skipping...") 211 | plane.run_empty() 212 | if not data_indexed: 213 | failed_count += 1 214 | elif source == "OPENS": 215 | from defOpenSky import pull_opensky 216 | planeData, failed = pull_opensky(planes) 217 | if failed == False: 218 | if planeData != None and planeData.states != []: 219 | # print(planeData.time) 220 | for key, obj in planes.items(): 221 | has_data = False 222 | for dataState in planeData.states: 223 | if (dataState.icao24).upper() == key: 224 | obj.run_opens(dataState) 225 | has_data = True 226 | break 227 | if has_data is False: 228 | obj.run_empty() 229 | else: 230 | for obj in planes.values(): 231 | obj.run_empty() 232 | elif failed: 233 | failed_count += 1 234 | if failed_count >= 10 and main_config.getboolean('DATA', 'FAILOVER'): 235 | if source == "OPENS": 236 | source = "ADSBX" 237 | elif source == "ADSBX": 238 | source = "OPENS" 239 | failed_count = 0 240 | if main_config.getboolean('DISCORD', 'ENABLE'): 241 | from defDiscord import sendDis 242 | sendDis(str("Failed over to " + source), main_config) 243 | elapsed_calc_time = time.time() - start_time 244 | datetime_tz = datetime.now(tz) 245 | footer = "-------- " + str(running_Count) + " -------- " + str(datetime_tz.strftime("%I:%M:%S %p")) + " ------------------------Elapsed Time- " + str(round(elapsed_calc_time, 3)) + " -------------------------------------" 246 | print (Back.GREEN + Fore.BLACK + footer[0:100] + Style.RESET_ALL) 247 | 248 | if main_config.has_section('SLEEP'): 249 | sleep_sec = int(main_config.get('SLEEP', 'SLEEPSEC')) 250 | else: 251 | sleep_sec = 30 252 | for i in range(sleep_sec,0,-1): 253 | if i < 10: 254 | i = " " + str(i) 255 | sys.stdout.write("\r") 256 | sys.stdout.write(Back.RED + "Sleep {00000000}".format(i) + Style.RESET_ALL) 257 | sys.stdout.flush() 258 | time.sleep(1) 259 | sys.stdout.write(Back.RED + ('\x1b[1K\r' +"Slept for " +str(sleep_sec)) + Style.RESET_ALL) 260 | print() 261 | except KeyboardInterrupt as e: 262 | print(e) 263 | if main_config.getboolean('DISCORD', 'ENABLE'): 264 | from defDiscord import sendDis 265 | sendDis(str("Manual Exit: " + str(e)), main_config) 266 | except Exception as e: 267 | if main_config.getboolean('DISCORD', 'ENABLE'): 268 | try: 269 | os.remove('crash_latest.log') 270 | except OSError: 271 | pass 272 | import logging 273 | logging.basicConfig(filename='crash_latest.log', filemode='w', format='%(asctime)s - %(message)s') 274 | logging.Formatter.converter = time.gmtime 275 | logging.error(e) 276 | logging.error(str(traceback.format_exc())) 277 | from defDiscord import sendDis 278 | sendDis(str("Error Exiting: " + str(e) + f"Failed on ({obj.config_path}) https://globe.theairtraffic.com/?icao={key} "), main_config, main_config.get('DISCORD', 'ROLE_ID'), "crash_latest.log") 279 | raise e 280 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /Pipfile.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_meta": { 3 | "hash": { 4 | "sha256": "1d80adfb6e58767e8fa25016043df0f2363d57f736d19e43e7dffc55ad511a73" 5 | }, 6 | "pipfile-spec": 6, 7 | "requires": { 8 | "python_version": "3.9" 9 | }, 10 | "sources": [ 11 | { 12 | "name": "pypi", 13 | "url": "https://pypi.org/simple", 14 | "verify_ssl": true 15 | } 16 | ] 17 | }, 18 | "default": { 19 | "appdirs": { 20 | "hashes": [ 21 | "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41", 22 | "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128" 23 | ], 24 | "version": "==1.4.4" 25 | }, 26 | "apscheduler": { 27 | "hashes": [ 28 | "sha256:3bb5229eed6fbbdafc13ce962712ae66e175aa214c69bed35a06bffcf0c5e244", 29 | "sha256:e8b1ecdb4c7cb2818913f766d5898183c7cb8936680710a4d3a966e02262e526" 30 | ], 31 | "version": "==3.6.3" 32 | }, 33 | "attrs": { 34 | "hashes": [ 35 | "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04", 36 | "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015" 37 | ], 38 | "markers": "python_version >= '3.7'", 39 | "version": "==23.1.0" 40 | }, 41 | "beautifulsoup4": { 42 | "hashes": [ 43 | "sha256:58d5c3d29f5a36ffeb94f02f0d786cd53014cf9b3b3951d42e0080d8a9498d30", 44 | "sha256:ad9aa55b65ef2808eb405f46cf74df7fcb7044d5cbc26487f96eb2ef2e436693" 45 | ], 46 | "index": "pypi", 47 | "version": "==4.11.1" 48 | }, 49 | "blurhash": { 50 | "hashes": [ 51 | "sha256:7611c1bc41383d2349b6129208587b5d61e8792ce953893cb49c38beeb400d1d", 52 | "sha256:da56b163e5a816e4ad07172f5639287698e09d7f3dc38d18d9726d9c1dbc4cee" 53 | ], 54 | "version": "==1.1.4" 55 | }, 56 | "cachetools": { 57 | "hashes": [ 58 | "sha256:2cc0b89715337ab6dbba85b5b50effe2b0c74e035d83ee8ed637cf52f12ae001", 59 | "sha256:61b5ed1e22a0924aed1d23b478f37e8d52549ff8a961de2909c69bf950020cff" 60 | ], 61 | "markers": "python_version ~= '3.5'", 62 | "version": "==4.2.2" 63 | }, 64 | "certifi": { 65 | "hashes": [ 66 | "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082", 67 | "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9" 68 | ], 69 | "index": "pypi", 70 | "version": "==2023.7.22" 71 | }, 72 | "charset-normalizer": { 73 | "hashes": [ 74 | "sha256:04e57ab9fbf9607b77f7d057974694b4f6b142da9ed4a199859d9d4d5c63fe96", 75 | "sha256:09393e1b2a9461950b1c9a45d5fd251dc7c6f228acab64da1c9c0165d9c7765c", 76 | "sha256:0b87549028f680ca955556e3bd57013ab47474c3124dc069faa0b6545b6c9710", 77 | "sha256:1000fba1057b92a65daec275aec30586c3de2401ccdcd41f8a5c1e2c87078706", 78 | "sha256:1249cbbf3d3b04902ff081ffbb33ce3377fa6e4c7356f759f3cd076cc138d020", 79 | "sha256:1920d4ff15ce893210c1f0c0e9d19bfbecb7983c76b33f046c13a8ffbd570252", 80 | "sha256:193cbc708ea3aca45e7221ae58f0fd63f933753a9bfb498a3b474878f12caaad", 81 | "sha256:1a100c6d595a7f316f1b6f01d20815d916e75ff98c27a01ae817439ea7726329", 82 | "sha256:1f30b48dd7fa1474554b0b0f3fdfdd4c13b5c737a3c6284d3cdc424ec0ffff3a", 83 | "sha256:203f0c8871d5a7987be20c72442488a0b8cfd0f43b7973771640fc593f56321f", 84 | "sha256:246de67b99b6851627d945db38147d1b209a899311b1305dd84916f2b88526c6", 85 | "sha256:2dee8e57f052ef5353cf608e0b4c871aee320dd1b87d351c28764fc0ca55f9f4", 86 | "sha256:2efb1bd13885392adfda4614c33d3b68dee4921fd0ac1d3988f8cbb7d589e72a", 87 | "sha256:2f4ac36d8e2b4cc1aa71df3dd84ff8efbe3bfb97ac41242fbcfc053c67434f46", 88 | "sha256:3170c9399da12c9dc66366e9d14da8bf7147e1e9d9ea566067bbce7bb74bd9c2", 89 | "sha256:3b1613dd5aee995ec6d4c69f00378bbd07614702a315a2cf6c1d21461fe17c23", 90 | "sha256:3bb3d25a8e6c0aedd251753a79ae98a093c7e7b471faa3aa9a93a81431987ace", 91 | "sha256:3bb7fda7260735efe66d5107fb7e6af6a7c04c7fce9b2514e04b7a74b06bf5dd", 92 | "sha256:41b25eaa7d15909cf3ac4c96088c1f266a9a93ec44f87f1d13d4a0e86c81b982", 93 | "sha256:45de3f87179c1823e6d9e32156fb14c1927fcc9aba21433f088fdfb555b77c10", 94 | "sha256:46fb8c61d794b78ec7134a715a3e564aafc8f6b5e338417cb19fe9f57a5a9bf2", 95 | "sha256:48021783bdf96e3d6de03a6e39a1171ed5bd7e8bb93fc84cc649d11490f87cea", 96 | "sha256:4957669ef390f0e6719db3613ab3a7631e68424604a7b448f079bee145da6e09", 97 | "sha256:5e86d77b090dbddbe78867a0275cb4df08ea195e660f1f7f13435a4649e954e5", 98 | "sha256:6339d047dab2780cc6220f46306628e04d9750f02f983ddb37439ca47ced7149", 99 | "sha256:681eb3d7e02e3c3655d1b16059fbfb605ac464c834a0c629048a30fad2b27489", 100 | "sha256:6c409c0deba34f147f77efaa67b8e4bb83d2f11c8806405f76397ae5b8c0d1c9", 101 | "sha256:7095f6fbfaa55defb6b733cfeb14efaae7a29f0b59d8cf213be4e7ca0b857b80", 102 | "sha256:70c610f6cbe4b9fce272c407dd9d07e33e6bf7b4aa1b7ffb6f6ded8e634e3592", 103 | "sha256:72814c01533f51d68702802d74f77ea026b5ec52793c791e2da806a3844a46c3", 104 | "sha256:7a4826ad2bd6b07ca615c74ab91f32f6c96d08f6fcc3902ceeedaec8cdc3bcd6", 105 | "sha256:7c70087bfee18a42b4040bb9ec1ca15a08242cf5867c58726530bdf3945672ed", 106 | "sha256:855eafa5d5a2034b4621c74925d89c5efef61418570e5ef9b37717d9c796419c", 107 | "sha256:8700f06d0ce6f128de3ccdbc1acaea1ee264d2caa9ca05daaf492fde7c2a7200", 108 | "sha256:89f1b185a01fe560bc8ae5f619e924407efca2191b56ce749ec84982fc59a32a", 109 | "sha256:8b2c760cfc7042b27ebdb4a43a4453bd829a5742503599144d54a032c5dc7e9e", 110 | "sha256:8c2f5e83493748286002f9369f3e6607c565a6a90425a3a1fef5ae32a36d749d", 111 | "sha256:8e098148dd37b4ce3baca71fb394c81dc5d9c7728c95df695d2dca218edf40e6", 112 | "sha256:94aea8eff76ee6d1cdacb07dd2123a68283cb5569e0250feab1240058f53b623", 113 | "sha256:95eb302ff792e12aba9a8b8f8474ab229a83c103d74a750ec0bd1c1eea32e669", 114 | "sha256:9bd9b3b31adcb054116447ea22caa61a285d92e94d710aa5ec97992ff5eb7cf3", 115 | "sha256:9e608aafdb55eb9f255034709e20d5a83b6d60c054df0802fa9c9883d0a937aa", 116 | "sha256:a103b3a7069b62f5d4890ae1b8f0597618f628b286b03d4bc9195230b154bfa9", 117 | "sha256:a386ebe437176aab38c041de1260cd3ea459c6ce5263594399880bbc398225b2", 118 | "sha256:a38856a971c602f98472050165cea2cdc97709240373041b69030be15047691f", 119 | "sha256:a401b4598e5d3f4a9a811f3daf42ee2291790c7f9d74b18d75d6e21dda98a1a1", 120 | "sha256:a7647ebdfb9682b7bb97e2a5e7cb6ae735b1c25008a70b906aecca294ee96cf4", 121 | "sha256:aaf63899c94de41fe3cf934601b0f7ccb6b428c6e4eeb80da72c58eab077b19a", 122 | "sha256:b0dac0ff919ba34d4df1b6131f59ce95b08b9065233446be7e459f95554c0dc8", 123 | "sha256:baacc6aee0b2ef6f3d308e197b5d7a81c0e70b06beae1f1fcacffdbd124fe0e3", 124 | "sha256:bf420121d4c8dce6b889f0e8e4ec0ca34b7f40186203f06a946fa0276ba54029", 125 | "sha256:c04a46716adde8d927adb9457bbe39cf473e1e2c2f5d0a16ceb837e5d841ad4f", 126 | "sha256:c0b21078a4b56965e2b12f247467b234734491897e99c1d51cee628da9786959", 127 | "sha256:c1c76a1743432b4b60ab3358c937a3fe1341c828ae6194108a94c69028247f22", 128 | "sha256:c4983bf937209c57240cff65906b18bb35e64ae872da6a0db937d7b4af845dd7", 129 | "sha256:c4fb39a81950ec280984b3a44f5bd12819953dc5fa3a7e6fa7a80db5ee853952", 130 | "sha256:c57921cda3a80d0f2b8aec7e25c8aa14479ea92b5b51b6876d975d925a2ea346", 131 | "sha256:c8063cf17b19661471ecbdb3df1c84f24ad2e389e326ccaf89e3fb2484d8dd7e", 132 | "sha256:ccd16eb18a849fd8dcb23e23380e2f0a354e8daa0c984b8a732d9cfaba3a776d", 133 | "sha256:cd6dbe0238f7743d0efe563ab46294f54f9bc8f4b9bcf57c3c666cc5bc9d1299", 134 | "sha256:d62e51710986674142526ab9f78663ca2b0726066ae26b78b22e0f5e571238dd", 135 | "sha256:db901e2ac34c931d73054d9797383d0f8009991e723dab15109740a63e7f902a", 136 | "sha256:e03b8895a6990c9ab2cdcd0f2fe44088ca1c65ae592b8f795c3294af00a461c3", 137 | "sha256:e1c8a2f4c69e08e89632defbfabec2feb8a8d99edc9f89ce33c4b9e36ab63037", 138 | "sha256:e4b749b9cc6ee664a3300bb3a273c1ca8068c46be705b6c31cf5d276f8628a94", 139 | "sha256:e6a5bf2cba5ae1bb80b154ed68a3cfa2fa00fde979a7f50d6598d3e17d9ac20c", 140 | "sha256:e857a2232ba53ae940d3456f7533ce6ca98b81917d47adc3c7fd55dad8fab858", 141 | "sha256:ee4006268ed33370957f55bf2e6f4d263eaf4dc3cfc473d1d90baff6ed36ce4a", 142 | "sha256:eef9df1eefada2c09a5e7a40991b9fc6ac6ef20b1372abd48d2794a316dc0449", 143 | "sha256:f058f6963fd82eb143c692cecdc89e075fa0828db2e5b291070485390b2f1c9c", 144 | "sha256:f25c229a6ba38a35ae6e25ca1264621cc25d4d38dca2942a7fce0b67a4efe918", 145 | "sha256:f2a1d0fd4242bd8643ce6f98927cf9c04540af6efa92323e9d3124f57727bfc1", 146 | "sha256:f7560358a6811e52e9c4d142d497f1a6e10103d3a6881f18d04dbce3729c0e2c", 147 | "sha256:f779d3ad205f108d14e99bb3859aa7dd8e9c68874617c72354d7ecaec2a054ac", 148 | "sha256:f87f746ee241d30d6ed93969de31e5ffd09a2961a051e60ae6bddde9ec3583aa" 149 | ], 150 | "markers": "python_version >= '3.7'", 151 | "version": "==3.2.0" 152 | }, 153 | "colorama": { 154 | "hashes": [ 155 | "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", 156 | "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6" 157 | ], 158 | "index": "pypi", 159 | "version": "==0.4.6" 160 | }, 161 | "configparser": { 162 | "hashes": [ 163 | "sha256:8be267824b541c09b08db124917f48ab525a6c3e837011f3130781a224c57090", 164 | "sha256:b065779fd93c6bf4cee42202fa4351b4bb842e96a3fb469440e484517a49b9fa" 165 | ], 166 | "index": "pypi", 167 | "version": "==5.3.0" 168 | }, 169 | "decorator": { 170 | "hashes": [ 171 | "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330", 172 | "sha256:b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186" 173 | ], 174 | "markers": "python_version >= '3.5'", 175 | "version": "==5.1.1" 176 | }, 177 | "discord-webhook": { 178 | "hashes": [ 179 | "sha256:b1ef5ae80ec9b28c978b7dbff07b9db2fd6597d728ac0524b27cd02336cedfca", 180 | "sha256:b4bb897d32509c5bedc6e1c8485431e8ba81eff5bec28a969c9fe33552a08da4" 181 | ], 182 | "index": "pypi", 183 | "version": "==1.0.0" 184 | }, 185 | "exceptiongroup": { 186 | "hashes": [ 187 | "sha256:12c3e887d6485d16943a309616de20ae5582633e0a2eda17f4e10fd61c1e8af5", 188 | "sha256:e346e69d186172ca7cf029c8c1d16235aa0e04035e5750b4b95039e65204328f" 189 | ], 190 | "markers": "python_version < '3.11'", 191 | "version": "==1.1.2" 192 | }, 193 | "future": { 194 | "hashes": [ 195 | "sha256:34a17436ed1e96697a86f9de3d15a3b0be01d8bc8de9c1dffd59fb8234ed5307" 196 | ], 197 | "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", 198 | "version": "==0.18.3" 199 | }, 200 | "geog": { 201 | "hashes": [ 202 | "sha256:9b6b020b72bf135d49299115e5a4a751f2432def4d4cd87d10b48a5ae51ec643" 203 | ], 204 | "index": "pypi", 205 | "version": "==0.0.2" 206 | }, 207 | "geographiclib": { 208 | "hashes": [ 209 | "sha256:6b7225248e45ff7edcee32becc4e0a1504c606ac5ee163a5656d482e0cd38734", 210 | "sha256:f7f41c85dc3e1c2d3d935ec86660dc3b2c848c83e17f9a9e51ba9d5146a15859" 211 | ], 212 | "markers": "python_version >= '3.7'", 213 | "version": "==2.0" 214 | }, 215 | "geopy": { 216 | "hashes": [ 217 | "sha256:228cd53b6eef699b2289d1172e462a90d5057779a10388a7366291812601187f", 218 | "sha256:4a29a16d41d8e56ba8e07310802a1cbdf098eeb6069cc3d6d3068fc770629ffc" 219 | ], 220 | "index": "pypi", 221 | "version": "==2.3.0" 222 | }, 223 | "h11": { 224 | "hashes": [ 225 | "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d", 226 | "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761" 227 | ], 228 | "markers": "python_version >= '3.7'", 229 | "version": "==0.14.0" 230 | }, 231 | "idna": { 232 | "hashes": [ 233 | "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4", 234 | "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2" 235 | ], 236 | "markers": "python_version >= '3.5'", 237 | "version": "==3.4" 238 | }, 239 | "lxml": { 240 | "hashes": [ 241 | "sha256:01d36c05f4afb8f7c20fd9ed5badca32a2029b93b1750f571ccc0b142531caf7", 242 | "sha256:04876580c050a8c5341d706dd464ff04fd597095cc8c023252566a8826505726", 243 | "sha256:05ca3f6abf5cf78fe053da9b1166e062ade3fa5d4f92b4ed688127ea7d7b1d03", 244 | "sha256:090c6543d3696cbe15b4ac6e175e576bcc3f1ccfbba970061b7300b0c15a2140", 245 | "sha256:0dc313ef231edf866912e9d8f5a042ddab56c752619e92dfd3a2c277e6a7299a", 246 | "sha256:0f2b1e0d79180f344ff9f321327b005ca043a50ece8713de61d1cb383fb8ac05", 247 | "sha256:13598ecfbd2e86ea7ae45ec28a2a54fb87ee9b9fdb0f6d343297d8e548392c03", 248 | "sha256:16efd54337136e8cd72fb9485c368d91d77a47ee2d42b057564aae201257d419", 249 | "sha256:1ab8f1f932e8f82355e75dda5413a57612c6ea448069d4fb2e217e9a4bed13d4", 250 | "sha256:223f4232855ade399bd409331e6ca70fb5578efef22cf4069a6090acc0f53c0e", 251 | "sha256:2455cfaeb7ac70338b3257f41e21f0724f4b5b0c0e7702da67ee6c3640835b67", 252 | "sha256:2899456259589aa38bfb018c364d6ae7b53c5c22d8e27d0ec7609c2a1ff78b50", 253 | "sha256:2a29ba94d065945944016b6b74e538bdb1751a1db6ffb80c9d3c2e40d6fa9894", 254 | "sha256:2a87fa548561d2f4643c99cd13131acb607ddabb70682dcf1dff5f71f781a4bf", 255 | "sha256:2e430cd2824f05f2d4f687701144556646bae8f249fd60aa1e4c768ba7018947", 256 | "sha256:36c3c175d34652a35475a73762b545f4527aec044910a651d2bf50de9c3352b1", 257 | "sha256:3818b8e2c4b5148567e1b09ce739006acfaa44ce3156f8cbbc11062994b8e8dd", 258 | "sha256:3ab9fa9d6dc2a7f29d7affdf3edebf6ece6fb28a6d80b14c3b2fb9d39b9322c3", 259 | "sha256:3efea981d956a6f7173b4659849f55081867cf897e719f57383698af6f618a92", 260 | "sha256:4c8f293f14abc8fd3e8e01c5bd86e6ed0b6ef71936ded5bf10fe7a5efefbaca3", 261 | "sha256:5344a43228767f53a9df6e5b253f8cdca7dfc7b7aeae52551958192f56d98457", 262 | "sha256:58bfa3aa19ca4c0f28c5dde0ff56c520fbac6f0daf4fac66ed4c8d2fb7f22e74", 263 | "sha256:5b4545b8a40478183ac06c073e81a5ce4cf01bf1734962577cf2bb569a5b3bbf", 264 | "sha256:5f50a1c177e2fa3ee0667a5ab79fdc6b23086bc8b589d90b93b4bd17eb0e64d1", 265 | "sha256:63da2ccc0857c311d764e7d3d90f429c252e83b52d1f8f1d1fe55be26827d1f4", 266 | "sha256:6749649eecd6a9871cae297bffa4ee76f90b4504a2a2ab528d9ebe912b101975", 267 | "sha256:6804daeb7ef69e7b36f76caddb85cccd63d0c56dedb47555d2fc969e2af6a1a5", 268 | "sha256:689bb688a1db722485e4610a503e3e9210dcc20c520b45ac8f7533c837be76fe", 269 | "sha256:699a9af7dffaf67deeae27b2112aa06b41c370d5e7633e0ee0aea2e0b6c211f7", 270 | "sha256:6b418afe5df18233fc6b6093deb82a32895b6bb0b1155c2cdb05203f583053f1", 271 | "sha256:76cf573e5a365e790396a5cc2b909812633409306c6531a6877c59061e42c4f2", 272 | "sha256:7b515674acfdcadb0eb5d00d8a709868173acece5cb0be3dd165950cbfdf5409", 273 | "sha256:7b770ed79542ed52c519119473898198761d78beb24b107acf3ad65deae61f1f", 274 | "sha256:7d2278d59425777cfcb19735018d897ca8303abe67cc735f9f97177ceff8027f", 275 | "sha256:7e91ee82f4199af8c43d8158024cbdff3d931df350252288f0d4ce656df7f3b5", 276 | "sha256:821b7f59b99551c69c85a6039c65b75f5683bdc63270fec660f75da67469ca24", 277 | "sha256:822068f85e12a6e292803e112ab876bc03ed1f03dddb80154c395f891ca6b31e", 278 | "sha256:8340225bd5e7a701c0fa98284c849c9b9fc9238abf53a0ebd90900f25d39a4e4", 279 | "sha256:85cabf64adec449132e55616e7ca3e1000ab449d1d0f9d7f83146ed5bdcb6d8a", 280 | "sha256:880bbbcbe2fca64e2f4d8e04db47bcdf504936fa2b33933efd945e1b429bea8c", 281 | "sha256:8d0b4612b66ff5d62d03bcaa043bb018f74dfea51184e53f067e6fdcba4bd8de", 282 | "sha256:8e20cb5a47247e383cf4ff523205060991021233ebd6f924bca927fcf25cf86f", 283 | "sha256:925073b2fe14ab9b87e73f9a5fde6ce6392da430f3004d8b72cc86f746f5163b", 284 | "sha256:998c7c41910666d2976928c38ea96a70d1aa43be6fe502f21a651e17483a43c5", 285 | "sha256:9b22c5c66f67ae00c0199f6055705bc3eb3fcb08d03d2ec4059a2b1b25ed48d7", 286 | "sha256:9f102706d0ca011de571de32c3247c6476b55bb6bc65a20f682f000b07a4852a", 287 | "sha256:a08cff61517ee26cb56f1e949cca38caabe9ea9fbb4b1e10a805dc39844b7d5c", 288 | "sha256:a0a336d6d3e8b234a3aae3c674873d8f0e720b76bc1d9416866c41cd9500ffb9", 289 | "sha256:a35f8b7fa99f90dd2f5dc5a9fa12332642f087a7641289ca6c40d6e1a2637d8e", 290 | "sha256:a38486985ca49cfa574a507e7a2215c0c780fd1778bb6290c21193b7211702ab", 291 | "sha256:a5da296eb617d18e497bcf0a5c528f5d3b18dadb3619fbdadf4ed2356ef8d941", 292 | "sha256:a6e441a86553c310258aca15d1c05903aaf4965b23f3bc2d55f200804e005ee5", 293 | "sha256:a82d05da00a58b8e4c0008edbc8a4b6ec5a4bc1e2ee0fb6ed157cf634ed7fa45", 294 | "sha256:ab323679b8b3030000f2be63e22cdeea5b47ee0abd2d6a1dc0c8103ddaa56cd7", 295 | "sha256:b1f42b6921d0e81b1bcb5e395bc091a70f41c4d4e55ba99c6da2b31626c44892", 296 | "sha256:b23e19989c355ca854276178a0463951a653309fb8e57ce674497f2d9f208746", 297 | "sha256:b264171e3143d842ded311b7dccd46ff9ef34247129ff5bf5066123c55c2431c", 298 | "sha256:b26a29f0b7fc6f0897f043ca366142d2b609dc60756ee6e4e90b5f762c6adc53", 299 | "sha256:b64d891da92e232c36976c80ed7ebb383e3f148489796d8d31a5b6a677825efe", 300 | "sha256:b9cc34af337a97d470040f99ba4282f6e6bac88407d021688a5d585e44a23184", 301 | "sha256:bc718cd47b765e790eecb74d044cc8d37d58562f6c314ee9484df26276d36a38", 302 | "sha256:be7292c55101e22f2a3d4d8913944cbea71eea90792bf914add27454a13905df", 303 | "sha256:c83203addf554215463b59f6399835201999b5e48019dc17f182ed5ad87205c9", 304 | "sha256:c9ec3eaf616d67db0764b3bb983962b4f385a1f08304fd30c7283954e6a7869b", 305 | "sha256:ca34efc80a29351897e18888c71c6aca4a359247c87e0b1c7ada14f0ab0c0fb2", 306 | "sha256:ca989b91cf3a3ba28930a9fc1e9aeafc2a395448641df1f387a2d394638943b0", 307 | "sha256:d02a5399126a53492415d4906ab0ad0375a5456cc05c3fc0fc4ca11771745cda", 308 | "sha256:d17bc7c2ccf49c478c5bdd447594e82692c74222698cfc9b5daae7ae7e90743b", 309 | "sha256:d5bf6545cd27aaa8a13033ce56354ed9e25ab0e4ac3b5392b763d8d04b08e0c5", 310 | "sha256:d6b430a9938a5a5d85fc107d852262ddcd48602c120e3dbb02137c83d212b380", 311 | "sha256:da248f93f0418a9e9d94b0080d7ebc407a9a5e6d0b57bb30db9b5cc28de1ad33", 312 | "sha256:da4dd7c9c50c059aba52b3524f84d7de956f7fef88f0bafcf4ad7dde94a064e8", 313 | "sha256:df0623dcf9668ad0445e0558a21211d4e9a149ea8f5666917c8eeec515f0a6d1", 314 | "sha256:e5168986b90a8d1f2f9dc1b841467c74221bd752537b99761a93d2d981e04889", 315 | "sha256:efa29c2fe6b4fdd32e8ef81c1528506895eca86e1d8c4657fda04c9b3786ddf9", 316 | "sha256:f1496ea22ca2c830cbcbd473de8f114a320da308438ae65abad6bab7867fe38f", 317 | "sha256:f49e52d174375a7def9915c9f06ec4e569d235ad428f70751765f48d5926678c" 318 | ], 319 | "index": "pypi", 320 | "version": "==4.9.2" 321 | }, 322 | "mastodon.py": { 323 | "hashes": [ 324 | "sha256:22bc7e060518ef2eaa69d911cde6e4baf56bed5ea0dd407392c49051a7ac526a", 325 | "sha256:4a64cb94abadd6add73e4b8eafdb5c466048fa5f638284fd2189034104d4687e" 326 | ], 327 | "index": "pypi", 328 | "version": "==1.8.1" 329 | }, 330 | "numpy": { 331 | "hashes": [ 332 | "sha256:012097b5b0d00a11070e8f2e261128c44157a8689f7dedcf35576e525893f4fe", 333 | "sha256:0d3fe3dd0506a28493d82dc3cf254be8cd0d26f4008a417385cbf1ae95b54004", 334 | "sha256:0def91f8af6ec4bb94c370e38c575855bf1d0be8a8fbfba42ef9c073faf2cf19", 335 | "sha256:1a180429394f81c7933634ae49b37b472d343cccb5bb0c4a575ac8bbc433722f", 336 | "sha256:1d5d3c68e443c90b38fdf8ef40e60e2538a27548b39b12b73132456847f4b631", 337 | "sha256:20e1266411120a4f16fad8efa8e0454d21d00b8c7cee5b5ccad7565d95eb42dd", 338 | "sha256:247d3ffdd7775bdf191f848be8d49100495114c82c2bd134e8d5d075fb386a1c", 339 | "sha256:35a9527c977b924042170a0887de727cd84ff179e478481404c5dc66b4170009", 340 | "sha256:38eb6548bb91c421261b4805dc44def9ca1a6eef6444ce35ad1669c0f1a3fc5d", 341 | "sha256:3d7abcdd85aea3e6cdddb59af2350c7ab1ed764397f8eec97a038ad244d2d105", 342 | "sha256:41a56b70e8139884eccb2f733c2f7378af06c82304959e174f8e7370af112e09", 343 | "sha256:4a90725800caeaa160732d6b31f3f843ebd45d6b5f3eec9e8cc287e30f2805bf", 344 | "sha256:6b82655dd8efeea69dbf85d00fca40013d7f503212bc5259056244961268b66e", 345 | "sha256:6c6c9261d21e617c6dc5eacba35cb68ec36bb72adcff0dee63f8fbc899362588", 346 | "sha256:77d339465dff3eb33c701430bcb9c325b60354698340229e1dff97745e6b3efa", 347 | "sha256:791f409064d0a69dd20579345d852c59822c6aa087f23b07b1b4e28ff5880fcb", 348 | "sha256:9a3a9f3a61480cc086117b426a8bd86869c213fc4072e606f01c4e4b66eb92bf", 349 | "sha256:c1516db588987450b85595586605742879e50dcce923e8973f79529651545b57", 350 | "sha256:c40571fe966393b212689aa17e32ed905924120737194b5d5c1b20b9ed0fb171", 351 | "sha256:d412c1697c3853c6fc3cb9751b4915859c7afe6a277c2bf00acf287d56c4e625", 352 | "sha256:d5154b1a25ec796b1aee12ac1b22f414f94752c5f94832f14d8d6c9ac40bcca6", 353 | "sha256:d736b75c3f2cb96843a5c7f8d8ccc414768d34b0a75f466c05f3a739b406f10b", 354 | "sha256:e8f6049c4878cb16960fbbfb22105e49d13d752d4d8371b55110941fb3b17800", 355 | "sha256:f76aebc3358ade9eacf9bc2bb8ae589863a4f911611694103af05346637df1b7", 356 | "sha256:fd67b306320dcadea700a8f79b9e671e607f8696e98ec255915c0c6d6b818503" 357 | ], 358 | "markers": "python_version >= '3.9'", 359 | "version": "==1.25.1" 360 | }, 361 | "oauthlib": { 362 | "hashes": [ 363 | "sha256:8139f29aac13e25d502680e9e19963e83f16838d48a0d71c287fe40e7067fbca", 364 | "sha256:9859c40929662bec5d64f34d01c99e093149682a3f38915dc0655d5a633dd918" 365 | ], 366 | "markers": "python_full_version >= '3.6.0'", 367 | "version": "==3.2.2" 368 | }, 369 | "opensky-api": { 370 | "editable": true, 371 | "git": "https://github.com/openskynetwork/opensky-api.git", 372 | "ref": "3d01d1a774da0dbd4a65a3bb615fd2063d0320c9", 373 | "subdirectory": "python" 374 | }, 375 | "outcome": { 376 | "hashes": [ 377 | "sha256:6f82bd3de45da303cf1f771ecafa1633750a358436a8bb60e06a1ceb745d2672", 378 | "sha256:c4ab89a56575d6d38a05aa16daeaa333109c1f96167aba8901ab18b6b5e0f7f5" 379 | ], 380 | "markers": "python_version >= '3.7'", 381 | "version": "==1.2.0" 382 | }, 383 | "packaging": { 384 | "hashes": [ 385 | "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61", 386 | "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f" 387 | ], 388 | "markers": "python_version >= '3.7'", 389 | "version": "==23.1" 390 | }, 391 | "pandas": { 392 | "hashes": [ 393 | "sha256:0183cb04a057cc38fde5244909fca9826d5d57c4a5b7390c0cc3fa7acd9fa883", 394 | "sha256:1fc87eac0541a7d24648a001d553406f4256e744d92df1df8ebe41829a915028", 395 | "sha256:220b98d15cee0b2cd839a6358bd1f273d0356bf964c1a1aeb32d47db0215488b", 396 | "sha256:2552bffc808641c6eb471e55aa6899fa002ac94e4eebfa9ec058649122db5824", 397 | "sha256:315e19a3e5c2ab47a67467fc0362cb36c7c60a93b6457f675d7d9615edad2ebe", 398 | "sha256:344021ed3e639e017b452aa8f5f6bf38a8806f5852e217a7594417fb9bbfa00e", 399 | "sha256:375262829c8c700c3e7cbb336810b94367b9c4889818bbd910d0ecb4e45dc261", 400 | "sha256:457d8c3d42314ff47cc2d6c54f8fc0d23954b47977b2caed09cd9635cb75388b", 401 | "sha256:4aed257c7484d01c9a194d9a94758b37d3d751849c05a0050c087a358c41ad1f", 402 | "sha256:530948945e7b6c95e6fa7aa4be2be25764af53fba93fe76d912e35d1c9ee46f5", 403 | "sha256:5ae7e989f12628f41e804847a8cc2943d362440132919a69429d4dea1f164da0", 404 | "sha256:71f510b0efe1629bf2f7c0eadb1ff0b9cf611e87b73cd017e6b7d6adb40e2b3a", 405 | "sha256:73f219fdc1777cf3c45fde7f0708732ec6950dfc598afc50588d0d285fddaefc", 406 | "sha256:8092a368d3eb7116e270525329a3e5c15ae796ccdf7ccb17839a73b4f5084a39", 407 | "sha256:82ae615826da838a8e5d4d630eb70c993ab8636f0eff13cb28aafc4291b632b5", 408 | "sha256:9608000a5a45f663be6af5c70c3cbe634fa19243e720eb380c0d378666bc7702", 409 | "sha256:a40dd1e9f22e01e66ed534d6a965eb99546b41d4d52dbdb66565608fde48203f", 410 | "sha256:b4f5a82afa4f1ff482ab8ded2ae8a453a2cdfde2001567b3ca24a4c5c5ca0db3", 411 | "sha256:c009a92e81ce836212ce7aa98b219db7961a8b95999b97af566b8dc8c33e9519", 412 | "sha256:c218796d59d5abd8780170c937b812c9637e84c32f8271bbf9845970f8c1351f", 413 | "sha256:cc3cd122bea268998b79adebbb8343b735a5511ec14efb70a39e7acbc11ccbdc", 414 | "sha256:d0d8fd58df5d17ddb8c72a5075d87cd80d71b542571b5f78178fb067fa4e9c72", 415 | "sha256:e18bc3764cbb5e118be139b3b611bc3fbc5d3be42a7e827d1096f46087b395eb", 416 | "sha256:e2b83abd292194f350bb04e188f9379d36b8dfac24dd445d5c87575f3beaf789", 417 | "sha256:e7469271497960b6a781eaa930cba8af400dd59b62ec9ca2f4d31a19f2f91090", 418 | "sha256:e9dbacd22555c2d47f262ef96bb4e30880e5956169741400af8b306bbb24a273", 419 | "sha256:f6257b314fc14958f8122779e5a1557517b0f8e500cfb2bd53fa1f75a8ad0af2" 420 | ], 421 | "index": "pypi", 422 | "version": "==1.5.2" 423 | }, 424 | "pillow": { 425 | "hashes": [ 426 | "sha256:03150abd92771742d4a8cd6f2fa6246d847dcd2e332a18d0c15cc75bf6703040", 427 | "sha256:073adb2ae23431d3b9bcbcff3fe698b62ed47211d0716b067385538a1b0f28b8", 428 | "sha256:0b07fffc13f474264c336298d1b4ce01d9c5a011415b79d4ee5527bb69ae6f65", 429 | "sha256:0b7257127d646ff8676ec8a15520013a698d1fdc48bc2a79ba4e53df792526f2", 430 | "sha256:12ce4932caf2ddf3e41d17fc9c02d67126935a44b86df6a206cf0d7161548627", 431 | "sha256:15c42fb9dea42465dfd902fb0ecf584b8848ceb28b41ee2b58f866411be33f07", 432 | "sha256:18498994b29e1cf86d505edcb7edbe814d133d2232d256db8c7a8ceb34d18cef", 433 | "sha256:1c7c8ae3864846fc95f4611c78129301e203aaa2af813b703c55d10cc1628535", 434 | "sha256:22b012ea2d065fd163ca096f4e37e47cd8b59cf4b0fd47bfca6abb93df70b34c", 435 | "sha256:276a5ca930c913f714e372b2591a22c4bd3b81a418c0f6635ba832daec1cbcfc", 436 | "sha256:2e0918e03aa0c72ea56edbb00d4d664294815aa11291a11504a377ea018330d3", 437 | "sha256:3033fbe1feb1b59394615a1cafaee85e49d01b51d54de0cbf6aa8e64182518a1", 438 | "sha256:3168434d303babf495d4ba58fc22d6604f6e2afb97adc6a423e917dab828939c", 439 | "sha256:32a44128c4bdca7f31de5be641187367fe2a450ad83b833ef78910397db491aa", 440 | "sha256:3dd6caf940756101205dffc5367babf288a30043d35f80936f9bfb37f8355b32", 441 | "sha256:40e1ce476a7804b0fb74bcfa80b0a2206ea6a882938eaba917f7a0f004b42502", 442 | "sha256:41e0051336807468be450d52b8edd12ac60bebaa97fe10c8b660f116e50b30e4", 443 | "sha256:4390e9ce199fc1951fcfa65795f239a8a4944117b5935a9317fb320e7767b40f", 444 | "sha256:502526a2cbfa431d9fc2a079bdd9061a2397b842bb6bc4239bb176da00993812", 445 | "sha256:51e0e543a33ed92db9f5ef69a0356e0b1a7a6b6a71b80df99f1d181ae5875636", 446 | "sha256:57751894f6618fd4308ed8e0c36c333e2f5469744c34729a27532b3db106ee20", 447 | "sha256:5d77adcd56a42d00cc1be30843d3426aa4e660cab4a61021dc84467123f7a00c", 448 | "sha256:655a83b0058ba47c7c52e4e2df5ecf484c1b0b0349805896dd350cbc416bdd91", 449 | "sha256:68943d632f1f9e3dce98908e873b3a090f6cba1cbb1b892a9e8d97c938871fbe", 450 | "sha256:6c738585d7a9961d8c2821a1eb3dcb978d14e238be3d70f0a706f7fa9316946b", 451 | "sha256:73bd195e43f3fadecfc50c682f5055ec32ee2c933243cafbfdec69ab1aa87cad", 452 | "sha256:772a91fc0e03eaf922c63badeca75e91baa80fe2f5f87bdaed4280662aad25c9", 453 | "sha256:77ec3e7be99629898c9a6d24a09de089fa5356ee408cdffffe62d67bb75fdd72", 454 | "sha256:7db8b751ad307d7cf238f02101e8e36a128a6cb199326e867d1398067381bff4", 455 | "sha256:801ec82e4188e935c7f5e22e006d01611d6b41661bba9fe45b60e7ac1a8f84de", 456 | "sha256:82409ffe29d70fd733ff3c1025a602abb3e67405d41b9403b00b01debc4c9a29", 457 | "sha256:828989c45c245518065a110434246c44a56a8b2b2f6347d1409c787e6e4651ee", 458 | "sha256:829f97c8e258593b9daa80638aee3789b7df9da5cf1336035016d76f03b8860c", 459 | "sha256:871b72c3643e516db4ecf20efe735deb27fe30ca17800e661d769faab45a18d7", 460 | "sha256:89dca0ce00a2b49024df6325925555d406b14aa3efc2f752dbb5940c52c56b11", 461 | "sha256:90fb88843d3902fe7c9586d439d1e8c05258f41da473952aa8b328d8b907498c", 462 | "sha256:97aabc5c50312afa5e0a2b07c17d4ac5e865b250986f8afe2b02d772567a380c", 463 | "sha256:9aaa107275d8527e9d6e7670b64aabaaa36e5b6bd71a1015ddd21da0d4e06448", 464 | "sha256:9f47eabcd2ded7698106b05c2c338672d16a6f2a485e74481f524e2a23c2794b", 465 | "sha256:a0a06a052c5f37b4ed81c613a455a81f9a3a69429b4fd7bb913c3fa98abefc20", 466 | "sha256:ab388aaa3f6ce52ac1cb8e122c4bd46657c15905904b3120a6248b5b8b0bc228", 467 | "sha256:ad58d27a5b0262c0c19b47d54c5802db9b34d38bbf886665b626aff83c74bacd", 468 | "sha256:ae5331c23ce118c53b172fa64a4c037eb83c9165aba3a7ba9ddd3ec9fa64a699", 469 | "sha256:af0372acb5d3598f36ec0914deed2a63f6bcdb7b606da04dc19a88d31bf0c05b", 470 | "sha256:afa4107d1b306cdf8953edde0534562607fe8811b6c4d9a486298ad31de733b2", 471 | "sha256:b03ae6f1a1878233ac620c98f3459f79fd77c7e3c2b20d460284e1fb370557d4", 472 | "sha256:b0915e734b33a474d76c28e07292f196cdf2a590a0d25bcc06e64e545f2d146c", 473 | "sha256:b4012d06c846dc2b80651b120e2cdd787b013deb39c09f407727ba90015c684f", 474 | "sha256:b472b5ea442148d1c3e2209f20f1e0bb0eb556538690fa70b5e1f79fa0ba8dc2", 475 | "sha256:b59430236b8e58840a0dfb4099a0e8717ffb779c952426a69ae435ca1f57210c", 476 | "sha256:b90f7616ea170e92820775ed47e136208e04c967271c9ef615b6fbd08d9af0e3", 477 | "sha256:b9a65733d103311331875c1dca05cb4606997fd33d6acfed695b1232ba1df193", 478 | "sha256:bac18ab8d2d1e6b4ce25e3424f709aceef668347db8637c2296bcf41acb7cf48", 479 | "sha256:bca31dd6014cb8b0b2db1e46081b0ca7d936f856da3b39744aef499db5d84d02", 480 | "sha256:be55f8457cd1eac957af0c3f5ece7bc3f033f89b114ef30f710882717670b2a8", 481 | "sha256:c7025dce65566eb6e89f56c9509d4f628fddcedb131d9465cacd3d8bac337e7e", 482 | "sha256:c935a22a557a560108d780f9a0fc426dd7459940dc54faa49d83249c8d3e760f", 483 | "sha256:dbb8e7f2abee51cef77673be97760abff1674ed32847ce04b4af90f610144c7b", 484 | "sha256:e6ea6b856a74d560d9326c0f5895ef8050126acfdc7ca08ad703eb0081e82b74", 485 | "sha256:ebf2029c1f464c59b8bdbe5143c79fa2045a581ac53679733d3a91d400ff9efb", 486 | "sha256:f1ff2ee69f10f13a9596480335f406dd1f70c3650349e2be67ca3139280cade0" 487 | ], 488 | "index": "pypi", 489 | "version": "==9.3.0" 490 | }, 491 | "py-staticmaps": { 492 | "hashes": [ 493 | "sha256:5aba5ad59f30a63f860e76ed99407a6efb24eaad5c8997aa8617363989f17389" 494 | ], 495 | "index": "pypi", 496 | "version": "==0.4.0" 497 | }, 498 | "pycairo": { 499 | "hashes": [ 500 | "sha256:1a6d8e0f353062ad92954784e33dbbaf66c880c9c30e947996c542ed9748aaaf", 501 | "sha256:2dec5378133778961993fb59d66df16070e03f4d491b67eb695ca9ad7a696008", 502 | "sha256:3a71f758e461180d241e62ef52e85499c843bd2660fd6d87cec99c9833792bfa", 503 | "sha256:564601e5f528531c6caec1c0177c3d0709081e1a2a5cccc13561f715080ae535", 504 | "sha256:82e335774a17870bc038e0c2fb106c1e5e7ad0c764662023886dfcfce5bb5a52", 505 | "sha256:87efd62a7b7afad9a0a420f05b6008742a6cfc59077697be65afe8dc73ae15ad", 506 | "sha256:9b61ac818723adc04367301317eb2e814a83522f07bbd1f409af0dada463c44c", 507 | "sha256:a4b1f525bbdf637c40f4d91378de36c01ec2b7f8ecc585b700a079b9ff83298e", 508 | "sha256:d6bacff15d688ed135b4567965a4b664d9fb8de7417a7865bb138ad612043c9f", 509 | "sha256:e7cde633986435d87a86b6118b7b6109c384266fd719ef959883e2729f6eafae", 510 | "sha256:ec305fc7f2f0299df78aadec0eaf6eb9accb90eda242b5d3492544d3f2b28027" 511 | ], 512 | "index": "pypi", 513 | "version": "==1.23.0" 514 | }, 515 | "pyproj": { 516 | "hashes": [ 517 | "sha256:0189fdd7aa789542a7a623010dfff066c5849b24397f81f860ec3ee085cbf55c", 518 | "sha256:0406f64ff59eb3342efb102c9f31536430aa5cde5ef0bfabd5aaccb73dd8cd5a", 519 | "sha256:0c7b32382ae22a9bf5b690d24c7b4c0fb89ba313c3a91ef1a8c54b50baf10954", 520 | "sha256:129234afa179c8293b010ea4f73655ff7b20b5afdf7fac170f223bcf0ed6defd", 521 | "sha256:19f5de1a7c3b81b676d846350d4bdf2ae6af13b9a450d1881706f088ecad0e2c", 522 | "sha256:231c038c6b65395c41ae3362320f03ce8054cb54dc63556e605695e5d461a27e", 523 | "sha256:25a5425cd2a0b16f5f944d49165196eebaa60b898a08c404a644c29e6a7a04b3", 524 | "sha256:261eb29b1d55b1eb7f336127344d9b31284d950a9446d1e0d1c2411f7dd8e3ac", 525 | "sha256:2bd633f3b8ca6eb09135dfaf06f09e2869deb139985aab26d728e8a60c9938b9", 526 | "sha256:2d1e7f42da205e0534831ae9aa9cee0353ab8c1aab2c369474adbb060294d98a", 527 | "sha256:2f87f16b902c8b2af007295c63a435f043db9e40bd45e6f96962c7b8cd08fdb5", 528 | "sha256:321b82210dc5271558573d0874b9967c5a25872a28d0168049ddabe8bfecffce", 529 | "sha256:3d70ca5933cddbe6f51396006fb9fc78bc2b1f9d28775922453c4b04625a7efb", 530 | "sha256:57ec7d2b7f2773d877927abc72e2229ef8530c09181be0e28217742bae1bc4f5", 531 | "sha256:5a53acbde511a7a9e1873c7f93c68f35b8c3653467b77195fe18e847555dcb7a", 532 | "sha256:5f3f75b030cf811f040c90a8758a20115e8746063e4cad0d0e941a4954d1219b", 533 | "sha256:6bdac3bc1899fcc4021be06d303b342923fb8311fe06f8d862c348a1a0e78b41", 534 | "sha256:7aef19d5a0a3b2d6b17f7dc9a87af722e71139cd1eea7eb82ed062a8a4b0e272", 535 | "sha256:8078c90cea07d53e3406c7c84cbf76a2ac0ffc580c365f13801575486b9d558c", 536 | "sha256:97065fe82e80f7e2740e7897a0e36e8defc0a3614927f0276b4f1d1ea1ef66fa", 537 | "sha256:a30d78e619dae5cd1bb69addae2f1e5f8ee1b4a8ab4f3d954e9eaf41948db506", 538 | "sha256:a32e1d12340ad93232b7ea4dc1a4f4b21fa9fa9efa4b293adad45be7af6b51ec", 539 | "sha256:a5eada965e8ac24e783f2493d1d9bcd11c5c93959bd43558224dd31d9faebd1c", 540 | "sha256:a98fe3e53be428e67ae6a9ee9affff92346622e0e3ea0cbc15dce939b318d395", 541 | "sha256:c240fe6bcb5c325b50fc967d5458d708412633f4f05fefc7fb14c14254ebf421", 542 | "sha256:c60d112d8f1621a606b7f2adb0b1582f80498e663413d2ba9f5df1c93d99f432", 543 | "sha256:cd9f9c409f465834988ce0aa8c1ed496081c6957f2e5ef40ed28de04397d3c0b", 544 | "sha256:ce50126dad7cd4749ab86fc4c8b54ec0898149ce6710ab5c93c76a54a4afa249", 545 | "sha256:da96319b137cfd66f0bae0e300cdc77dd17af4785b9360a9bdddb1d7176a0bbb", 546 | "sha256:e463c687007861a9949909211986850cfc2e72930deda0d06449ef2e315db534", 547 | "sha256:e8c0d1ac9ef5a4d2e6501a4b30136c55f1e1db049d1626cc313855c4f97d196d", 548 | "sha256:e9d82df555cf19001bac40e1de0e40fb762dec785685b77edd6993286c01b7f7", 549 | "sha256:ef76abfee1a0676ef973470abe11e22998750f2bd944afaf76d44ad70b538c06", 550 | "sha256:ef8c30c62fe4e386e523e14e1e83bd460f745bd2c8dfd0d0c327f9460c4d3c0c", 551 | "sha256:f38dea459e22e86326b1c7d47718a3e10c7a27910cf5eb86ea2679b8084d0c4e" 552 | ], 553 | "index": "pypi", 554 | "version": "==3.4.1" 555 | }, 556 | "pysocks": { 557 | "hashes": [ 558 | "sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299", 559 | "sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5", 560 | "sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0" 561 | ], 562 | "version": "==1.7.1" 563 | }, 564 | "python-dateutil": { 565 | "hashes": [ 566 | "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86", 567 | "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9" 568 | ], 569 | "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", 570 | "version": "==2.8.2" 571 | }, 572 | "python-dotenv": { 573 | "hashes": [ 574 | "sha256:a8df96034aae6d2d50a4ebe8216326c61c3eb64836776504fcca410e5937a3ba", 575 | "sha256:f5971a9226b701070a4bf2c38c89e5a3f0d64de8debda981d1db98583009122a" 576 | ], 577 | "markers": "python_version >= '3.8'", 578 | "version": "==1.0.0" 579 | }, 580 | "python-magic": { 581 | "hashes": [ 582 | "sha256:c1ba14b08e4a5f5c31a302b7721239695b2f0f058d125bd5ce1ee36b9d9d3c3b", 583 | "sha256:c212960ad306f700aa0d01e5d7a325d20548ff97eb9920dcd29513174f0294d3" 584 | ], 585 | "markers": "platform_system != 'Windows'", 586 | "version": "==0.4.27" 587 | }, 588 | "python-slugify": { 589 | "hashes": [ 590 | "sha256:70ca6ea68fe63ecc8fa4fcf00ae651fc8a5d02d93dcd12ae6d4fc7ca46c4d395", 591 | "sha256:ce0d46ddb668b3be82f4ed5e503dbc33dd815d83e2eb6824211310d3fb172a27" 592 | ], 593 | "markers": "python_version >= '3.7'", 594 | "version": "==8.0.1" 595 | }, 596 | "python-telegram-bot": { 597 | "hashes": [ 598 | "sha256:06780c258d3f2a3c6c79a7aeb45714f4cd1dd6275941b7dc4628bba64fddd465", 599 | "sha256:b4047606b8081b62bbd6aa361f7ca1efe87fa8f1881ec9d932d35844bf57a154" 600 | ], 601 | "index": "pypi", 602 | "version": "==13.15" 603 | }, 604 | "pytz": { 605 | "hashes": [ 606 | "sha256:7ccfae7b4b2c067464a6733c6261673fdb8fd1be905460396b97a073e9fa683a", 607 | "sha256:93007def75ae22f7cd991c84e02d434876818661f8df9ad5df9e950ff4e52cfd" 608 | ], 609 | "index": "pypi", 610 | "version": "==2022.7" 611 | }, 612 | "requests": { 613 | "hashes": [ 614 | "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f", 615 | "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1" 616 | ], 617 | "markers": "python_version >= '3.7'", 618 | "version": "==2.31.0" 619 | }, 620 | "requests-oauthlib": { 621 | "hashes": [ 622 | "sha256:2577c501a2fb8d05a304c09d090d6e47c306fef15809d102b327cf8364bddab5", 623 | "sha256:75beac4a47881eeb94d5ea5d6ad31ef88856affe2332b9aafb52c6452ccf0d7a" 624 | ], 625 | "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", 626 | "version": "==1.3.1" 627 | }, 628 | "s2sphere": { 629 | "hashes": [ 630 | "sha256:c2478c1ff7c601a59a7151a57b605435897514578fa6bdb8730721c182adbbaf", 631 | "sha256:d2340c9cf458ddc9a89afd1d8048a4195ce6fa6b0095ab900d4be5271e537401" 632 | ], 633 | "version": "==0.2.5" 634 | }, 635 | "selenium": { 636 | "hashes": [ 637 | "sha256:06a1c7d9f313130b21c3218ddd8852070d0e7419afdd31f96160cd576555a5ce", 638 | "sha256:3aefa14a28a42e520550c1cd0f29cf1d566328186ea63aa9a3e01fb265b5894d" 639 | ], 640 | "index": "pypi", 641 | "version": "==4.7.2" 642 | }, 643 | "setuptools": { 644 | "hashes": [ 645 | "sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f", 646 | "sha256:baf1fdb41c6da4cd2eae722e135500da913332ab3f2f5c7d33af9b492acb5235" 647 | ], 648 | "markers": "python_version >= '3.7'", 649 | "version": "==68.0.0" 650 | }, 651 | "shapely": { 652 | "hashes": [ 653 | "sha256:11f1b1231a6c04213fb1226c6968d1b1b3b369ec42d1e9655066af87631860ea", 654 | "sha256:13a9f978cd287e0fa95f39904a2bb36deddab490e4fab8bf43eba01b7d9eb58f", 655 | "sha256:17d0f89581aa15f7887052a6adf2753f9fe1c3fdbb6116653972e0d43e720e65", 656 | "sha256:21ba32a6c45b7f8ab7d2d8d5cf339704e2d1dfdf3e2fb465b950a0c9bc894a4f", 657 | "sha256:2287d0cb592c1814e9f48065888af7ee3f13e090e6f7fa3e208b06a83fb2f6af", 658 | "sha256:292c22ff7806e3a25bc4324295e9204169c61a09165d4c9ee0a9784c1709c85e", 659 | "sha256:40c397d67ba609a163d38b649eee2b06c5f9bdc86d244a8e4cd09c6e2791cf3c", 660 | "sha256:44198fc188fe4b7dd39ef0fd325395d1d6ab0c29a7bbaa15663a16c362bf6f62", 661 | "sha256:5477be8c11bf3109f7b804bb2d57536538b8d0a6118207f1020d71338f1a827c", 662 | "sha256:550f110940d79931b6a12a17de07f6b158c9586c4b121f885af11458ae5626d7", 663 | "sha256:56c0e70749f8c2956493e9333375d2e2264ce25c838fc49c3a2ececbf2d3ba92", 664 | "sha256:5fe8649aafe6adcb4d90f7f735f06ca8ca02a16da273d901f1dd02afc0d3618e", 665 | "sha256:6c71738702cf5c3fc60b3bbe869c321b053ea754f57addded540a71c78c2612e", 666 | "sha256:7266080d39946395ba4b31fa35b9b7695e0a4e38ccabf0c67e2936caf9f9b054", 667 | "sha256:73771b3f65c2949cce0b310b9b62b8ce069407ceb497a9dd4436f9a4d059f12c", 668 | "sha256:73d605fcefd06ee997ba307ef363448d355f3c3e81b3f56ed332eaf6d506e1b5", 669 | "sha256:7b2c41514ba985ea3772eee9b386d620784cccb7a459a270a072f3ef01fdd807", 670 | "sha256:820bee508e4a0e564db22f8b55bb5e6e7f326d8d7c103639c42f5d3f378f4067", 671 | "sha256:8a7ba97c97d85c1f07c57f9524c45128ef2bf8279061945d78052c78862b357f", 672 | "sha256:8b9f780c3b79b4a6501e0e8833b1877841b7b0e0a243e77b529fda8f1030afc2", 673 | "sha256:91bbca0378eb82f0808f0e59150ac0952086f4caaab87ad8515a5e55e896c21e", 674 | "sha256:99420c89af78f371b96f0e2bad9afdebc6d0707d4275d157101483e4c4049fd6", 675 | "sha256:a391cae931976fb6d8d15a4f4a92006358e93486454a812dde1d64184041a476", 676 | "sha256:a9b6651812f2caa23e4d06bc06a2ed34450f82cb1c110c170a25b01bbb090895", 677 | "sha256:b1def13ec2a74ebda2210d2fc1c53cecce5a079ec90f341101399427874507f1", 678 | "sha256:b3d97f3ce6df47ca68c2d64b8c3cfa5c8ccc0fbc81ef8e15ff6004a6426e71b1", 679 | "sha256:c47a61b1cd0c5b064c6d912bce7dba78c01f319f65ecccd6e61eecd21861a37a", 680 | "sha256:c4b99a3456e06dc55482569669ece969cdab311f2ad2a1d5622fc770f68cf3cd", 681 | "sha256:d28e19791c9be2ba1cb2fddefa86f73364bdf8334e88dbcd78a8e4494c0af66b", 682 | "sha256:d486cab823f0a978964ae97ca10564ea2b2ced93e84a2ef0b7b62cbacec9d3d2", 683 | "sha256:de3722c68e49fbde8cb6859695bbb8fb9a4d48bbdf34fcf38b7994d2bd9772e2", 684 | "sha256:e4ed31658fd0799eaa3569982aab1a5bc8fcf25ec196606bf137ee4fa984be88", 685 | "sha256:e991ad155783cd0830b895ec8f310fde9e79a7b283776b889a751fb1e7c819fc", 686 | "sha256:eab24b60ae96b7375adceb1f120be818c59bd69db0f3540dc89527d8a371d253", 687 | "sha256:eaea9ddee706654026a84aceb9a3156105917bab3de58fcf150343f847478202", 688 | "sha256:ef98fec4a3aca6d33e3b9fdd680fe513cc7d1c6aedc65ada8a3965601d9d4bcf", 689 | "sha256:f69c418f2040c8593e33b1aba8f2acf890804b073b817535b5d291139d152af5", 690 | "sha256:f96b24da0242791cd6042f6caf074e7a4537a66ca2d1b57d423feb98ba901295" 691 | ], 692 | "index": "pypi", 693 | "version": "==2.0.0" 694 | }, 695 | "six": { 696 | "hashes": [ 697 | "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", 698 | "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" 699 | ], 700 | "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", 701 | "version": "==1.16.0" 702 | }, 703 | "sniffio": { 704 | "hashes": [ 705 | "sha256:e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101", 706 | "sha256:eecefdce1e5bbfb7ad2eeaabf7c1eeb404d7757c379bd1f7e5cce9d8bf425384" 707 | ], 708 | "markers": "python_version >= '3.7'", 709 | "version": "==1.3.0" 710 | }, 711 | "sortedcontainers": { 712 | "hashes": [ 713 | "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88", 714 | "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0" 715 | ], 716 | "version": "==2.4.0" 717 | }, 718 | "soupsieve": { 719 | "hashes": [ 720 | "sha256:1c1bfee6819544a3447586c889157365a27e10d88cde3ad3da0cf0ddf646feb8", 721 | "sha256:89d12b2d5dfcd2c9e8c22326da9d9aa9cb3dfab0a83a024f05704076ee8d35ea" 722 | ], 723 | "markers": "python_version >= '3.7'", 724 | "version": "==2.4.1" 725 | }, 726 | "svgwrite": { 727 | "hashes": [ 728 | "sha256:a8fbdfd4443302a6619a7f76bc937fc683daf2628d9b737c891ec08b8ce524c3", 729 | "sha256:bb6b2b5450f1edbfa597d924f9ac2dd099e625562e492021d7dd614f65f8a22d" 730 | ], 731 | "markers": "python_full_version >= '3.6.0'", 732 | "version": "==1.4.3" 733 | }, 734 | "tabulate": { 735 | "hashes": [ 736 | "sha256:0095b12bf5966de529c0feb1fa08671671b3368eec77d7ef7ab114be2c068b3c", 737 | "sha256:024ca478df22e9340661486f85298cff5f6dcdba14f3813e8830015b9ed1948f" 738 | ], 739 | "index": "pypi", 740 | "version": "==0.9.0" 741 | }, 742 | "text-unidecode": { 743 | "hashes": [ 744 | "sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8", 745 | "sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93" 746 | ], 747 | "version": "==1.3" 748 | }, 749 | "tornado": { 750 | "hashes": [ 751 | "sha256:0a00ff4561e2929a2c37ce706cb8233b7907e0cdc22eab98888aca5dd3775feb", 752 | "sha256:0d321a39c36e5f2c4ff12b4ed58d41390460f798422c4504e09eb5678e09998c", 753 | "sha256:1e8225a1070cd8eec59a996c43229fe8f95689cb16e552d130b9793cb570a288", 754 | "sha256:20241b3cb4f425e971cb0a8e4ffc9b0a861530ae3c52f2b0434e6c1b57e9fd95", 755 | "sha256:25ad220258349a12ae87ede08a7b04aca51237721f63b1808d39bdb4b2164558", 756 | "sha256:33892118b165401f291070100d6d09359ca74addda679b60390b09f8ef325ffe", 757 | "sha256:33c6e81d7bd55b468d2e793517c909b139960b6c790a60b7991b9b6b76fb9791", 758 | "sha256:3447475585bae2e77ecb832fc0300c3695516a47d46cefa0528181a34c5b9d3d", 759 | "sha256:34ca2dac9e4d7afb0bed4677512e36a52f09caa6fded70b4e3e1c89dbd92c326", 760 | "sha256:3e63498f680547ed24d2c71e6497f24bca791aca2fe116dbc2bd0ac7f191691b", 761 | "sha256:548430be2740e327b3fe0201abe471f314741efcb0067ec4f2d7dcfb4825f3e4", 762 | "sha256:6196a5c39286cc37c024cd78834fb9345e464525d8991c21e908cc046d1cc02c", 763 | "sha256:61b32d06ae8a036a6607805e6720ef00a3c98207038444ba7fd3d169cd998910", 764 | "sha256:6286efab1ed6e74b7028327365cf7346b1d777d63ab30e21a0f4d5b275fc17d5", 765 | "sha256:65d98939f1a2e74b58839f8c4dab3b6b3c1ce84972ae712be02845e65391ac7c", 766 | "sha256:66324e4e1beede9ac79e60f88de548da58b1f8ab4b2f1354d8375774f997e6c0", 767 | "sha256:6c77c9937962577a6a76917845d06af6ab9197702a42e1346d8ae2e76b5e3675", 768 | "sha256:70dec29e8ac485dbf57481baee40781c63e381bebea080991893cd297742b8fd", 769 | "sha256:7250a3fa399f08ec9cb3f7b1b987955d17e044f1ade821b32e5f435130250d7f", 770 | "sha256:748290bf9112b581c525e6e6d3820621ff020ed95af6f17fedef416b27ed564c", 771 | "sha256:7da13da6f985aab7f6f28debab00c67ff9cbacd588e8477034c0652ac141feea", 772 | "sha256:8f959b26f2634a091bb42241c3ed8d3cedb506e7c27b8dd5c7b9f745318ddbb6", 773 | "sha256:9de9e5188a782be6b1ce866e8a51bc76a0fbaa0e16613823fc38e4fc2556ad05", 774 | "sha256:a48900ecea1cbb71b8c71c620dee15b62f85f7c14189bdeee54966fbd9a0c5bd", 775 | "sha256:b87936fd2c317b6ee08a5741ea06b9d11a6074ef4cc42e031bc6403f82a32575", 776 | "sha256:c77da1263aa361938476f04c4b6c8916001b90b2c2fdd92d8d535e1af48fba5a", 777 | "sha256:cb5ec8eead331e3bb4ce8066cf06d2dfef1bfb1b2a73082dfe8a161301b76e37", 778 | "sha256:cc0ee35043162abbf717b7df924597ade8e5395e7b66d18270116f8745ceb795", 779 | "sha256:d14d30e7f46a0476efb0deb5b61343b1526f73ebb5ed84f23dc794bdb88f9d9f", 780 | "sha256:d371e811d6b156d82aa5f9a4e08b58debf97c302a35714f6f45e35139c332e32", 781 | "sha256:d3d20ea5782ba63ed13bc2b8c291a053c8d807a8fa927d941bd718468f7b950c", 782 | "sha256:d3f7594930c423fd9f5d1a76bee85a2c36fd8b4b16921cae7e965f22575e9c01", 783 | "sha256:dcef026f608f678c118779cd6591c8af6e9b4155c44e0d1bc0c87c036fb8c8c4", 784 | "sha256:e0791ac58d91ac58f694d8d2957884df8e4e2f6687cdf367ef7eb7497f79eaa2", 785 | "sha256:e385b637ac3acaae8022e7e47dfa7b83d3620e432e3ecb9a3f7f58f150e50921", 786 | "sha256:e519d64089b0876c7b467274468709dadf11e41d65f63bba207e04217f47c085", 787 | "sha256:e7229e60ac41a1202444497ddde70a48d33909e484f96eb0da9baf8dc68541df", 788 | "sha256:ed3ad863b1b40cd1d4bd21e7498329ccaece75db5a5bf58cd3c9f130843e7102", 789 | "sha256:f0ba29bafd8e7e22920567ce0d232c26d4d47c8b5cf4ed7b562b5db39fa199c5", 790 | "sha256:fa2ba70284fa42c2a5ecb35e322e68823288a4251f9ba9cc77be04ae15eada68", 791 | "sha256:fba85b6cd9c39be262fcd23865652920832b61583de2a2ca907dbd8e8a8c81e5" 792 | ], 793 | "markers": "python_version >= '3.5'", 794 | "version": "==6.1" 795 | }, 796 | "tqdm": { 797 | "hashes": [ 798 | "sha256:1871fb68a86b8fb3b59ca4cdd3dcccbc7e6d613eeed31f4c332531977b89beb5", 799 | "sha256:c4f53a17fe37e132815abceec022631be8ffe1b9381c2e6e30aa70edc99e9671" 800 | ], 801 | "markers": "python_version >= '3.7'", 802 | "version": "==4.65.0" 803 | }, 804 | "trio": { 805 | "hashes": [ 806 | "sha256:3887cf18c8bcc894433420305468388dac76932e9668afa1c49aa3806b6accb3", 807 | "sha256:f43da357620e5872b3d940a2e3589aa251fd3f881b65a608d742e00809b1ec38" 808 | ], 809 | "markers": "python_version >= '3.7'", 810 | "version": "==0.22.2" 811 | }, 812 | "trio-websocket": { 813 | "hashes": [ 814 | "sha256:1a748604ad906a7dcab9a43c6eb5681e37de4793ba0847ef0bc9486933ed027b", 815 | "sha256:a9937d48e8132ebf833019efde2a52ca82d223a30a7ea3e8d60a7d28f75a4e3a" 816 | ], 817 | "markers": "python_version >= '3.7'", 818 | "version": "==0.10.3" 819 | }, 820 | "tweepy": { 821 | "hashes": [ 822 | "sha256:5e4c5b5d22f9e5dd9678a708fae4e40e6eeb1a860a89891a5de3040d5f3da8fe", 823 | "sha256:86d4f6738cbd5a57f86dff7ae0caf52f66004d5777626bf5da970aa8c8aa35df" 824 | ], 825 | "index": "pypi", 826 | "version": "==4.12.1" 827 | }, 828 | "tzlocal": { 829 | "hashes": [ 830 | "sha256:46eb99ad4bdb71f3f72b7d24f4267753e240944ecfc16f25d2719ba89827a803", 831 | "sha256:f3596e180296aaf2dbd97d124fe76ae3a0e3d32b258447de7b939b3fd4be992f" 832 | ], 833 | "markers": "python_version >= '3.7'", 834 | "version": "==5.0.1" 835 | }, 836 | "urllib3": { 837 | "extras": [ 838 | "socks" 839 | ], 840 | "hashes": [ 841 | "sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f", 842 | "sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14" 843 | ], 844 | "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", 845 | "version": "==1.26.16" 846 | }, 847 | "webdriver-manager": { 848 | "hashes": [ 849 | "sha256:2d807ec270d2d990022b86efabd4096053e0a1e7a34c6174f9937320dfdc6826", 850 | "sha256:e671f3b738af52351341d6df6674c2f0b959db0fe978e9a7135cfa36d1ad9560" 851 | ], 852 | "index": "pypi", 853 | "version": "==3.8.5" 854 | }, 855 | "wsproto": { 856 | "hashes": [ 857 | "sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065", 858 | "sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736" 859 | ], 860 | "markers": "python_version >= '3.7'", 861 | "version": "==1.2.0" 862 | } 863 | }, 864 | "develop": {} 865 | } 866 | -------------------------------------------------------------------------------- /planeClass.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime, timedelta 2 | class Plane: 3 | import configparser 4 | main_config = configparser.ConfigParser() 5 | main_config.read('./configs/mainconf.ini') 6 | def __init__(self, icao, config_path, config): 7 | """Initializes a plane object from its config file and given icao.""" 8 | self.icao = icao.upper() 9 | self.callsign = None 10 | self.config = config 11 | self.config_path = config_path 12 | self.overrides = {} 13 | if self.config.has_option('DATA', 'OVERRIDE_REG'): 14 | self.reg = self.config.get('DATA', 'OVERRIDE_REG') 15 | self.overrides['reg'] = self.reg 16 | else: 17 | self.reg = None 18 | if self.config.has_option('DATA', 'OVERRIDE_ICAO_TYPE'): 19 | self.type = self.config.get('DATA', 'OVERRIDE_ICAO_TYPE') 20 | self.overrides['type'] = self.type 21 | else: 22 | self.type = None 23 | if self.config.has_option('DATA', 'OVERRIDE_ICAO_TYPE'): 24 | self.overrides['typelong'] = self.config.get('DATA', 'OVERRIDE_TYPELONG') 25 | if self.config.has_option('DATA', 'OVERRIDE_OWNER'): 26 | self.overrides['ownop'] = self.config.get('DATA', 'OVERRIDE_OWNER') 27 | if self.config.has_option('DATA', 'CONCEAL_AC_ID'): 28 | self.conceal_ac_id = self.config.getboolean('DATA', 'CONCEAL_AC_ID') 29 | else: 30 | self.conceal_ac_id = False 31 | if self.config.has_option('DATA', 'CONCEAL_PIA'): 32 | self.conceal_pia = self.config.getboolean('DATA', 'CONCEAL_PIA') 33 | else: 34 | self.conceal_pia = False 35 | self.conf_file_path = config_path 36 | self.alt_ft = None 37 | self.below_desired_ft = None 38 | self.last_below_desired_ft = None 39 | self.feeding = None 40 | self.last_feeding = None 41 | self.last_on_ground = None 42 | self.on_ground = None 43 | self.longitude = None 44 | self.latitude = None 45 | self.takeoff_time = None 46 | import tempfile 47 | self.map_file_name = f"{tempfile.gettempdir()}/{icao.upper()}_map.png" 48 | self.last_latitude = None 49 | self.last_longitude = None 50 | self.last_pos_datetime = None 51 | self.landing_plausible = False 52 | self.nav_modes = None 53 | self.last_nav_modes = None 54 | self.speed = None 55 | self.recent_ra_types = {} 56 | self.db_flags = None 57 | self.sel_nav_alt = None 58 | self.last_sel_alt = None 59 | self.squawk = None 60 | self.emergency_already_triggered = None 61 | self.last_emergency = None 62 | self.recheck_route_time = None 63 | self.known_to_airport = None 64 | self.track = None 65 | self.last_track = None 66 | self.circle_history = None 67 | self.nearest_from_airport = None 68 | if self.config.has_option('DATA', 'DATA_LOSS_MINS'): 69 | self.data_loss_mins = self.config.getint('DATA', 'DATA_LOSS_MINS') 70 | else: 71 | self.data_loss_mins = Plane.main_config.getint('DATA', 'DATA_LOSS_MINS') 72 | #Setup Tweepy 73 | if self.config.getboolean('TWITTER', 'ENABLE') and Plane.main_config.getboolean('TWITTER', 'ENABLE'): 74 | import tweepy 75 | twitter_app_auth = tweepy.OAuthHandler(Plane.main_config.get('TWITTER', 'CONSUMER_KEY'), Plane.main_config.get('TWITTER', 'CONSUMER_SECRET')) 76 | twitter_app_auth.set_access_token(config.get('TWITTER', 'ACCESS_TOKEN'), config.get('TWITTER', 'ACCESS_TOKEN_SECRET')) 77 | self.tweet_api = tweepy.API(twitter_app_auth, wait_on_rate_limit=True) 78 | try: 79 | self.latest_tweet_id = self.tweet_api.user_timeline(count = 1)[0] 80 | except IndexError: 81 | self.latest_tweet_id = None 82 | def run_opens(self, ac_dict): 83 | #Parse OpenSky Vector 84 | from colorama import Fore, Back, Style 85 | self.print_header("BEGIN") 86 | #print (Fore.YELLOW + "OpenSky Sourced Data: ", ac_dict) 87 | try: 88 | self.__dict__.update({ 89 | 'icao' : ac_dict.icao24.upper(), 90 | 'callsign' : ac_dict.callsign, 91 | 'latitude' : ac_dict.latitude, 92 | 'longitude' : ac_dict.longitude, 93 | 'on_ground' : bool(ac_dict.on_ground), 94 | 'squawk' : ac_dict.squawk, 95 | 'track' : float(ac_dict.true_track)}) 96 | if ac_dict.baro_altitude != None: 97 | self.alt_ft = round(float(ac_dict.baro_altitude) * 3.281) 98 | elif self.on_ground: 99 | self.alt_ft = 0 100 | from mictronics_parse import get_aircraft_reg_by_icao, get_type_code_by_icao 101 | self.reg = get_aircraft_reg_by_icao(self.icao) 102 | self.type = get_type_code_by_icao(self.icao) 103 | if ac_dict.time_position is not None: 104 | self.last_pos_datetime = datetime.fromtimestamp(ac_dict.time_position) 105 | except ValueError as e: 106 | print("Got data but some data is invalid!") 107 | print(e) 108 | self.print_header("END") 109 | else: 110 | self.feeding = True 111 | self.run_check() 112 | def run_adsbx_v1(self, ac_dict): 113 | #Parse ADBSX V1 Vector 114 | from colorama import Fore, Back, Style 115 | self.print_header("BEGIN") 116 | #print (Fore.YELLOW +"ADSBX Sourced Data: ", ac_dict, Style.RESET_ALL) 117 | try: 118 | #postime is divided by 1000 to get seconds from milliseconds, from timestamp expects secs. 119 | self.__dict__.update({'icao' : ac_dict['icao'].upper(), 'callsign' : ac_dict['call'], 'reg' : ac_dict['reg'], 'latitude' : float(ac_dict['lat']), 'longitude' : float(ac_dict['lon']), 'alt_ft' : int(ac_dict['alt']), 'on_ground' : bool(int(ac_dict["gnd"])), 'squawk' : ac_dict['sqk'], 'track' : float(ac_dict["trak"])}) 120 | if self.on_ground: 121 | self.alt_ft = 0 122 | self.last_pos_datetime = datetime.fromtimestamp(int(ac_dict['postime'])/1000) 123 | except ValueError as e: 124 | 125 | print("Got data but some data is invalid!") 126 | print(e) 127 | print (Fore.YELLOW +"ADSBX Sourced Data: ", ac_dict, Style.RESET_ALL) 128 | self.print_header("END") 129 | else: 130 | self.feeding = True 131 | self.run_check() 132 | 133 | def run_adsbx_v2(self, ac_dict): 134 | #Parse ADBSX V2 Vector 135 | from colorama import Fore, Back, Style 136 | self.print_header("BEGIN") 137 | print(ac_dict) 138 | try: 139 | self.__dict__.update({'icao' : ac_dict['hex'].upper(), 'latitude' : float(ac_dict['lat']), 'longitude' : float(ac_dict['lon']), 'speed': ac_dict['gs']}) 140 | if "r" in ac_dict: 141 | self.reg = ac_dict['r'] 142 | if "t" in ac_dict: 143 | self.type = ac_dict['t'] 144 | if ac_dict['alt_baro'] != "ground": 145 | self.alt_ft = int(ac_dict['alt_baro']) 146 | self.on_ground = False 147 | elif ac_dict['alt_baro'] == "ground": 148 | self.alt_ft = 0 149 | self.on_ground = True 150 | if ac_dict.get('flight') is not None: 151 | self.callsign = ac_dict.get('flight').strip() 152 | else: 153 | self.callsign = None 154 | if ac_dict.get('dbFlags') is not None: 155 | self.db_flags = ac_dict['dbFlags'] 156 | if 'nav_modes' in ac_dict: 157 | self.nav_modes = ac_dict['nav_modes'] 158 | for idx, mode in enumerate(self.nav_modes): 159 | if mode.upper() in ['TCAS', 'LNAV', 'VNAV']: 160 | self.nav_modes[idx] = self.nav_modes[idx].upper() 161 | else: 162 | self.nav_modes[idx] = self.nav_modes[idx].capitalize() 163 | self.squawk = ac_dict.get('squawk') 164 | if "track" in ac_dict: 165 | self.track = ac_dict['track'] 166 | if "nav_altitude_fms" in ac_dict: 167 | self.sel_nav_alt = ac_dict['nav_altitude_fms'] 168 | elif "nav_altitude_mcp" in ac_dict: 169 | self.sel_nav_alt = ac_dict['nav_altitude_mcp'] 170 | else: 171 | self.sel_nav_alt = None 172 | 173 | #Create last seen timestamp from how long ago in secs a pos was rec 174 | self.last_pos_datetime = datetime.now() - timedelta(seconds= ac_dict["seen_pos"]) 175 | except (ValueError, KeyError) as e: 176 | 177 | print("Got data but some data is invalid!") 178 | print(e) 179 | print (Fore.YELLOW +"ADSBX Sourced Data: ", ac_dict, Style.RESET_ALL) 180 | self.print_header("END") 181 | else: 182 | #Error Handling for bad data, sometimes it would seem to be ADSB Decode error 183 | if (not self.on_ground) and self.speed <= 10: 184 | print("Not running check, appears to be bad ADSB Decode") 185 | else: 186 | self.feeding = True 187 | self.run_check() 188 | def __str__(self): 189 | from colorama import Fore, Back, Style 190 | from tabulate import tabulate 191 | if self.last_pos_datetime is not None: 192 | time_since_contact = self.get_time_since(self.last_pos_datetime) 193 | output = [ 194 | [(Fore.CYAN + "ICAO" + Style.RESET_ALL), (Fore.LIGHTGREEN_EX + self.icao + Style.RESET_ALL)], 195 | [(Fore.CYAN + "Callsign" + Style.RESET_ALL), (Fore.LIGHTGREEN_EX + self.callsign + Style.RESET_ALL)] if self.callsign is not None else None, 196 | [(Fore.CYAN + "Reg" + Style.RESET_ALL), (Fore.LIGHTGREEN_EX + self.reg + Style.RESET_ALL)] if self.reg is not None else None, 197 | [(Fore.CYAN + "Squawk" + Style.RESET_ALL), (Fore.LIGHTGREEN_EX + self.squawk + Style.RESET_ALL)] if self.squawk is not None else None, 198 | [(Fore.CYAN + "Coordinates" + Style.RESET_ALL), (Fore.LIGHTGREEN_EX + str(self.latitude) + ", " + str(self.longitude) + Style.RESET_ALL)] if self.latitude is not None and self.longitude is not None else None, 199 | [(Fore.CYAN + "Last Contact" + Style.RESET_ALL), (Fore.LIGHTGREEN_EX + str(time_since_contact).split(".")[0]+ Style.RESET_ALL)] if self.last_pos_datetime is not None else None, 200 | [(Fore.CYAN + "On Ground" + Style.RESET_ALL), (Fore.LIGHTGREEN_EX + str(self.on_ground) + Style.RESET_ALL)] if self.on_ground is not None else None, 201 | [(Fore.CYAN + "Baro Altitude" + Style.RESET_ALL), (Fore.LIGHTGREEN_EX + str("{:,} ft".format(self.alt_ft)) + Style.RESET_ALL)] if self.alt_ft is not None else None, 202 | [(Fore.CYAN + "Nav Modes" + Style.RESET_ALL), (Fore.LIGHTGREEN_EX + ', '.join(self.nav_modes) + Style.RESET_ALL)] if "nav_modes" in self.__dict__ and self.nav_modes != None else None, 203 | [(Fore.CYAN + "Sel Alt Ft" + Style.RESET_ALL), (Fore.LIGHTGREEN_EX + str("{:,} ft".format(self.sel_nav_alt)) + Style.RESET_ALL)] if "sel_nav_alt" in self.__dict__ and self.sel_nav_alt is not None else None 204 | ] 205 | output = list(filter(None, output)) 206 | return tabulate(output, [], 'fancy_grid') 207 | def print_header(self, note): 208 | from colorama import Fore, Back, Style 209 | if note == "BEGIN": 210 | header = f"---BEGIN---------{self.conf_file_path}" 211 | elif note == "END": 212 | header = f"---END" 213 | remaning_len = 85 - len(header) 214 | for x in range(0, remaning_len): 215 | header += "-" 216 | header += f"ICAO: {self.icao}---" 217 | if note =="END": 218 | header += Style.RESET_ALL + "\n" 219 | print(Back.MAGENTA + header + Style.RESET_ALL) 220 | def get_time_since(self, datetime_obj): 221 | if datetime_obj != None: 222 | time_since = datetime.now() - datetime_obj 223 | else: 224 | time_since = None 225 | return time_since 226 | def get_adsbx_map_overlays(self): 227 | if self.config.has_option('MAP', 'OVERLAYS'): 228 | overlays = self.config.get('MAP', 'OVERLAYS') 229 | else: 230 | overlays = "null" 231 | return overlays 232 | def route_info(self): 233 | from lookup_route import lookup_route, clean_data 234 | def route_format(extra_route_info, type): 235 | from defAirport import get_airport_by_icao 236 | to_airport = get_airport_by_icao(self.known_to_airport) 237 | if to_airport: 238 | code = to_airport['iata_code'] if to_airport['iata_code'] != "" else to_airport['icao'] 239 | airport_text = f"{code}, {to_airport['name']}" 240 | else: 241 | airport_text = f"{self.known_to_airport}" 242 | if 'time_to' in extra_route_info.keys() and type != "divert": 243 | arrival_rel = "in ~" + extra_route_info['time_to'] 244 | else: 245 | arrival_rel = None 246 | if self.known_to_airport != self.nearest_from_airport: 247 | if type == "inital": 248 | header = "Going to" 249 | elif type == "change": 250 | header = "Now going to" 251 | elif type == "divert": 252 | header = "Now diverting to" 253 | if to_airport: 254 | area = f"{to_airport['municipality']}, {to_airport['region']}, {to_airport['iso_country']}" 255 | else: 256 | area = "" 257 | route_to = f"{header} {area} ({airport_text})" + (f" arriving {arrival_rel}" if arrival_rel is not None else "") 258 | else: 259 | if type == "inital": 260 | header = "Will be returning to" 261 | elif type == "change": 262 | header = "Now returning to" 263 | elif type == "divert": 264 | header = "Now diverting back to" 265 | route_to = f"{header} {airport_text}" + (f" {arrival_rel}" if arrival_rel is not None else "") 266 | return route_to 267 | if hasattr(self, "type"): 268 | extra_route_info = clean_data(lookup_route(self.reg, (self.latitude, self.longitude), self.type, self.alt_ft)) 269 | else: 270 | extra_route_info = None 271 | route_to = None 272 | if extra_route_info is None: 273 | pass 274 | elif extra_route_info is not None: 275 | #Diversion 276 | if "divert_icao" in extra_route_info.keys(): 277 | if self.known_to_airport != extra_route_info["divert_icao"]: 278 | self.known_to_airport = extra_route_info['divert_icao'] 279 | route_to = route_format(extra_route_info, "divert") 280 | #Destination 281 | elif "dest_icao" in extra_route_info.keys(): 282 | #Inital Destination Found 283 | if self.known_to_airport is None: 284 | self.known_to_airport = extra_route_info['dest_icao'] 285 | route_to = route_format(extra_route_info, "inital") 286 | #Destination Change 287 | elif self.known_to_airport != extra_route_info["dest_icao"]: 288 | self.known_to_airport = extra_route_info['dest_icao'] 289 | route_to = route_format(extra_route_info, "change") 290 | 291 | return route_to 292 | def run_empty(self): 293 | self.print_header("BEGIN") 294 | self.feeding = False 295 | self.run_check() 296 | def run_check(self): 297 | """Runs a check of a plane module to see if its landed or takenoff using plane data, and takes action if so.""" 298 | print(self) 299 | #Ability to Remove old Map 300 | import os 301 | from colorama import Fore, Style 302 | from tabulate import tabulate 303 | #Proprietary Route Lookup 304 | if os.path.isfile("lookup_route.py") and (self.db_flags is None or not self.db_flags & 1): 305 | from lookup_route import lookup_route 306 | ENABLE_ROUTE_LOOKUP = True 307 | else: 308 | ENABLE_ROUTE_LOOKUP = False 309 | if self.config.getboolean('DISCORD', 'ENABLE'): 310 | from defDiscord import sendDis 311 | if self.last_pos_datetime is not None: 312 | time_since_contact = self.get_time_since(self.last_pos_datetime) 313 | #Check if below desire ft 314 | desired_ft = 15000 315 | if self.alt_ft is None or self.alt_ft > desired_ft: 316 | self.below_desired_ft = False 317 | elif self.alt_ft < desired_ft: 318 | self.below_desired_ft = True 319 | #Check if tookoff 320 | if self.below_desired_ft and self.on_ground is False: 321 | if self.last_on_ground: 322 | self.tookoff = True 323 | trigger_type = "no longer on ground" 324 | type_header = "Took off from" 325 | elif self.last_feeding is False and self.feeding and self.landing_plausible == False: 326 | from defAirport import getClosestAirport 327 | nearest_airport_dict = getClosestAirport(self.latitude, self.longitude, self.config.get("AIRPORT", "TYPES")) 328 | if nearest_airport_dict['elevation_ft'] != "": 329 | alt_above_airport = (self.alt_ft - int(nearest_airport_dict['elevation_ft'])) 330 | print(f"AGL nearest airport: {alt_above_airport}") 331 | else: 332 | alt_above_airport = None 333 | if (alt_above_airport != None and alt_above_airport <= 10000) or self.alt_ft <= 15000: 334 | self.tookoff = True 335 | trigger_type = "data acquisition" 336 | type_header = "Took off near" 337 | else: 338 | self.tookoff = False 339 | else: 340 | self.tookoff = False 341 | 342 | #Check if Landed 343 | if self.on_ground and self.last_on_ground is False and self.last_below_desired_ft: 344 | self.landed = True 345 | trigger_type = "now on ground" 346 | type_header = "Landed in" 347 | self.landing_plausible = False 348 | #Set status for landing plausible 349 | elif self.below_desired_ft and self.last_feeding and self.feeding is False and self.last_on_ground is False: 350 | self.landing_plausible = True 351 | print("Near landing conditions, if contiuned data loss for configured time, and if under 10k AGL landing true") 352 | 353 | elif self.landing_plausible and self.feeding is False and time_since_contact.total_seconds() >= (self.data_loss_mins * 60): 354 | from defAirport import getClosestAirport 355 | nearest_airport_dict = getClosestAirport(self.latitude, self.longitude, self.config.get("AIRPORT", "TYPES")) 356 | if nearest_airport_dict['elevation_ft'] != "": 357 | alt_above_airport = (self.alt_ft - int(nearest_airport_dict['elevation_ft'])) 358 | print(f"AGL nearest airport: {alt_above_airport}") 359 | else: 360 | alt_above_airport = None 361 | if (alt_above_airport != None and alt_above_airport <= 10000) or self.alt_ft <= 15000: 362 | self.landing_plausible = False 363 | self.on_ground = None 364 | self.landed = True 365 | trigger_type = "data loss" 366 | type_header = "Landed near" 367 | else: 368 | print("Alt greater then 10k AGL") 369 | self.landing_plausible = False 370 | self.on_ground = None 371 | else: 372 | self.landed = False 373 | 374 | if self.landed: 375 | print ("Landed by", trigger_type) 376 | if self.tookoff: 377 | print("Tookoff by", trigger_type) 378 | #Find nearest airport, and location 379 | if self.landed or self.tookoff: 380 | from defAirport import getClosestAirport 381 | if "nearest_airport_dict" in globals(): 382 | pass #Airport already set 383 | elif trigger_type in ["now on ground", "data acquisition", "data loss"]: 384 | nearest_airport_dict = getClosestAirport(self.latitude, self.longitude, self.config.get("AIRPORT", "TYPES")) 385 | elif trigger_type == "no longer on ground": 386 | nearest_airport_dict = getClosestAirport(self.last_latitude, self.last_longitude, self.config.get("AIRPORT", "TYPES")) 387 | #Convert dictionary keys to sep variables 388 | country_code = nearest_airport_dict['iso_country'] 389 | state = nearest_airport_dict['region'].strip() 390 | municipality = nearest_airport_dict['municipality'].strip() 391 | if municipality == "" or state == "" or municipality == state: 392 | if municipality != "": 393 | area = municipality 394 | elif state != "": 395 | area = state 396 | else: 397 | area = "" 398 | else: 399 | area = f"{municipality}, {state}" 400 | location_string = (f"{area}, {country_code}") 401 | print (Fore.GREEN + "Country Code:", country_code, "State:", state, "Municipality:", municipality + Style.RESET_ALL) 402 | dynamic_title = self.callsign or self.reg or self.icao 403 | #Set Discord Title 404 | if self.config.getboolean('DISCORD', 'ENABLE'): 405 | if self.config.get('DISCORD', 'TITLE') in ["DYNAMIC", "callsign"]: 406 | self.dis_title = dynamic_title 407 | else: 408 | self.dis_title = self.config.get('DISCORD', 'TITLE') 409 | #Set Twitter Title 410 | if self.config.getboolean('TWITTER', 'ENABLE') and Plane.main_config.getboolean('TWITTER', 'ENABLE'): 411 | if self.config.get('TWITTER', 'TITLE') in ["DYNAMIC", "callsign"]: 412 | self.twitter_title = dynamic_title 413 | else: 414 | self.twitter_title = self.config.get('TWITTER', 'TITLE') 415 | #Takeoff and Land Notification 416 | if self.tookoff or self.landed: 417 | route_to = None 418 | if self.tookoff: 419 | self.takeoff_time = datetime.utcnow() 420 | landed_time_msg = None 421 | #Proprietary Route Lookup 422 | if ENABLE_ROUTE_LOOKUP: 423 | self.nearest_from_airport = nearest_airport_dict['icao'] 424 | route_to = self.route_info() 425 | if route_to is None: 426 | self.recheck_route_time = 1 427 | else: 428 | self.recheck_route_time = 10 429 | elif self.landed and self.takeoff_time != None: 430 | landed_time = datetime.utcnow() - self.takeoff_time 431 | if trigger_type == "data loss": 432 | landed_time -= timedelta(seconds=time_since_contact.total_seconds()) 433 | hours, remainder = divmod(landed_time.total_seconds(), 3600) 434 | minutes, seconds = divmod(remainder, 60) 435 | min_syntax = "min" 436 | if hours > 0: 437 | hour_syntax = "h" 438 | landed_time_msg = (f"Apx. flt. time {int(hours)} {hour_syntax}" + (f" {int(minutes)} {min_syntax}. " if minutes > 0 else ".")) 439 | else: 440 | landed_time_msg = (f"Apx. flt. time {int(minutes)} {min_syntax}.") 441 | self.takeoff_time = None 442 | elif self.landed: 443 | landed_time_msg = None 444 | landed_time = None 445 | 446 | message = (f"{type_header} {location_string}.") + ("" if route_to is None else f" {route_to}.") + ((f" {landed_time_msg}") if landed_time_msg != None else "") 447 | print (message) 448 | #Google Map or tar1090 screenshot 449 | if Plane.main_config.get('MAP', 'OPTION') == "GOOGLESTATICMAP": 450 | from defMap import getMap 451 | getMap((municipality + ", " + state + ", " + country_code), self.map_file_name) 452 | elif Plane.main_config.get('MAP', 'OPTION') == "ADSBX": 453 | from defSS import get_adsbx_screenshot 454 | url_params = f"largeMode=2&hideButtons&hideSidebar&mapDim=0&zoom=10&icao={self.icao}&overlays={self.get_adsbx_map_overlays()}&limitupdates=0" 455 | get_adsbx_screenshot(self.map_file_name, url_params, overrides=self.overrides, conceal_ac_id=self.conceal_ac_id, conceal_pia=self.conceal_pia) 456 | from modify_image import append_airport 457 | text_credit = self.config.get('MAP', 'TEXT_CREDIT') if self.config.has_option('MAP', 'TEXT_CREDIT') else None 458 | append_airport(self.map_file_name, nearest_airport_dict, text_credit) 459 | else: 460 | raise ValueError("Map option not set correctly in this planes conf") 461 | #Telegram 462 | if self.config.has_section('TELEGRAM') and self.config.getboolean('TELEGRAM', 'ENABLE'): 463 | from defTelegram import sendTeleg 464 | photo = open(self.map_file_name, "rb") 465 | sendTeleg(photo, message, self.config) 466 | #Mastodon 467 | if self.config.has_section('MASTODON') and self.config.getboolean('MASTODON', 'ENABLE'): 468 | from defMastodon import sendMastodon 469 | sendMastodon(self.map_file_name, message, self.config) 470 | 471 | #Discord 472 | if self.config.getboolean('DISCORD', 'ENABLE'): 473 | role_id = self.config.get('DISCORD', 'ROLE_ID') if self.config.has_option('DISCORD', 'ROLE_ID') and self.config.get('DISCORD', 'ROLE_ID').strip() != "" else None 474 | sendDis(message, self.config, role_id, self.map_file_name) 475 | #Twitter 476 | if self.config.getboolean('TWITTER', 'ENABLE') and Plane.main_config.getboolean('TWITTER', 'ENABLE'): 477 | import tweepy 478 | try: 479 | twitter_media_map_obj = self.tweet_api.media_upload(self.map_file_name) 480 | alt_text = f"Reg: {self.reg} On Ground: {str(self.on_ground)} Alt: {str(self.alt_ft)} Last Contact: {str(time_since_contact)} Trigger: {trigger_type}" 481 | self.tweet_api.create_media_metadata(media_id= twitter_media_map_obj.media_id, alt_text= alt_text) 482 | self.latest_tweet_id = self.tweet_api.update_status(status = ((self.twitter_title + " " + message).strip()), media_ids=[twitter_media_map_obj.media_id]).id 483 | except tweepy.errors.TweepyException as e: 484 | raise 485 | #Meta 486 | if self.config.has_option('META', 'ENABLE') and self.config.getboolean('META', 'ENABLE'): 487 | from meta_toolkit import post_to_meta_both 488 | post_to_meta_both(self.config.get("META", "FB_PAGE_ID"), self.config.get("META", "IG_USER_ID"), self.map_file_name, message, self.config.get("META", "ACCESS_TOKEN")) 489 | os.remove(self.map_file_name) 490 | if self.landed: 491 | if nearest_airport_dict is not None and self.nearest_from_airport is not None and nearest_airport_dict['icao'] != self.nearest_from_airport: 492 | from defAirport import get_airport_by_icao 493 | from geopy.distance import geodesic 494 | landed_airport = nearest_airport_dict 495 | nearest_from_airport = get_airport_by_icao(self.nearest_from_airport) 496 | from_coord = (nearest_from_airport['latitude_deg'], nearest_from_airport['longitude_deg']) 497 | to_coord = (landed_airport['latitude_deg'], landed_airport['longitude_deg']) 498 | distance_mi = float(geodesic(from_coord, to_coord).mi) 499 | distance_nm = distance_mi / 1.150779448 500 | distance_message = f"{'{:,}'.format(round(distance_mi))} mile ({'{:,}'.format(round(distance_nm))} NM) flight from {nearest_from_airport['iata_code'] if nearest_from_airport['iata_code'] != '' else nearest_from_airport['ident']} to {nearest_airport_dict['iata_code'] if nearest_airport_dict['iata_code'] != '' else nearest_airport_dict['ident']}\n" 501 | else: 502 | distance_message = "" 503 | if landed_time is not None and self.type is not None: 504 | print("Running fuel info calc") 505 | flight_time_min = landed_time.total_seconds() / 60 506 | from fuel_calc import fuel_calculation, fuel_message 507 | fuel_info = fuel_calculation(self.type, flight_time_min) 508 | if fuel_info is not None: 509 | fuel_message = fuel_message(fuel_info) 510 | if self.config.getboolean('DISCORD', 'ENABLE'): 511 | dis_message = f"{self.dis_title} {distance_message} \nFlight Fuel Info ```{fuel_message}```".strip() 512 | role_id = self.config.get('DISCORD', 'ROLE_ID') if self.config.has_option('DISCORD', 'ROLE_ID') and self.config.get('DISCORD', 'ROLE_ID').strip() != "" else None 513 | sendDis(dis_message, self.config, role_id) 514 | if self.config.getboolean('TWITTER', 'ENABLE') and Plane.main_config.getboolean('TWITTER', 'ENABLE'): 515 | try: 516 | self.latest_tweet_id = self.tweet_api.update_status(status = ((self.twitter_title + " " + distance_message + " " + fuel_message).strip()), in_reply_to_status_id = self.latest_tweet_id).id 517 | except tweepy.errors.TweepyException as e: 518 | raise 519 | self.latest_tweet_id = None 520 | self.recheck_route_time = None 521 | self.known_to_airport = None 522 | self.nearest_from_airport = None 523 | #Recheck Proprietary Route Info. 524 | if self.takeoff_time is not None and self.recheck_route_time is not None and (datetime.utcnow() - self.takeoff_time).total_seconds() > 60 * self.recheck_route_time: 525 | self.recheck_route_time += 10 526 | route_to = self.route_info() 527 | if route_to != None: 528 | print(route_to) 529 | #Telegram 530 | if self.config.has_section('TELEGRAM') and self.config.getboolean('TELEGRAM', 'ENABLE'): 531 | message = f"{self.dis_title} {route_to}".strip() 532 | photo = open(self.map_file_name, "rb") 533 | from defTelegram import sendTeleg 534 | sendTeleg(photo, message, self.config) 535 | #Discord 536 | if self.config.getboolean('DISCORD', 'ENABLE'): 537 | dis_message = f"{self.dis_title} {route_to}".strip() 538 | role_id = self.config.get('DISCORD', 'ROLE_ID') if self.config.has_option('DISCORD', 'ROLE_ID') and self.config.get('DISCORD', 'ROLE_ID').strip() != "" else None 539 | sendDis(dis_message, self.config, role_id) 540 | #Twitter 541 | if self.config.getboolean('TWITTER', 'ENABLE') and Plane.main_config.getboolean('TWITTER', 'ENABLE'): 542 | self.latest_tweet_id = self.tweet_api.update_status(status = f"{self.twitter_title} {route_to}".strip(), in_reply_to_status_id = self.latest_tweet_id).id 543 | 544 | if self.circle_history is not None: 545 | #Expires traces for circles 546 | if self.circle_history["traces"] != []: 547 | for trace in self.circle_history["traces"]: 548 | if (datetime.now() - datetime.fromtimestamp(trace[0])).total_seconds() >= 20*60: 549 | print("Trace Expire, removed") 550 | self.circle_history["traces"].remove(trace) 551 | #Expire touchngo 552 | if "touchngo" in self.circle_history.keys() and (datetime.now() - datetime.fromtimestamp(self.circle_history['touchngo'])).total_seconds() >= 10*60: 553 | self.circle_history.pop("touchngo") 554 | if self.feeding: 555 | #Squawks 556 | emergency_squawks ={"7500" : "Hijacking", "7600" :"Radio Failure", "7700" : "General Emergency"} 557 | if self.last_pos_datetime is not None: 558 | seen = datetime.now() - self.last_pos_datetime 559 | #Only run check if emergency data previously set 560 | if self.last_emergency is not None and not self.emergency_already_triggered: 561 | time_since_org_emer = datetime.now() - self.last_emergency[0] 562 | #Checks times to see x time and still same squawk 563 | if time_since_org_emer.total_seconds() >= 60 and self.last_emergency[1] == self.squawk and seen.total_seconds() <= 60: 564 | self.emergency_already_triggered = True 565 | squawk_message = (f"{self.dis_title} Squawking {self.last_emergency[1]} {emergency_squawks[self.squawk]}").strip() 566 | print(squawk_message) 567 | #Google Map or tar1090 screenshot 568 | if Plane.main_config.get('MAP', 'OPTION') == "GOOGLESTATICMAP": 569 | getMap((municipality + ", " + state + ", " + country_code), self.map_file_name) 570 | if Plane.main_config.get('MAP', 'OPTION') == "ADSBX": 571 | from defSS import get_adsbx_screenshot 572 | url_params = f"largeMode=2&hideButtons&hideSidebar&mapDim=0&zoom=10&icao={self.icao}&overlays={self.get_adsbx_map_overlays()}&limitupdates=0" 573 | get_adsbx_screenshot(self.map_file_name, url_params, overrides=self.overrides, conceal_ac_id=self.conceal_ac_id, conceal_pia=self.conceal_pia) 574 | if self.config.getboolean('DISCORD', 'ENABLE'): 575 | dis_message = (self.dis_title + " " + squawk_message) 576 | sendDis(dis_message, self.config, None, self.map_file_name) 577 | os.remove(self.map_file_name) 578 | #Realizes first time seeing emergency, stores time and type 579 | elif self.squawk in emergency_squawks.keys() and not self.emergency_already_triggered and not self.on_ground: 580 | print("Emergency", self.squawk, "detected storing code and time and waiting to trigger") 581 | if self.last_pos_datetime is not None: 582 | self.last_emergency = (self.last_pos_datetime, self.squawk) 583 | elif self.squawk not in emergency_squawks.keys() and self.emergency_already_triggered: 584 | self.emergency_already_triggered = None 585 | 586 | #Nav Modes Notifications 587 | if self.nav_modes != None and self.last_nav_modes != None: 588 | for mode in self.nav_modes: 589 | if mode not in self.last_nav_modes: 590 | #Discord 591 | print(mode, "enabled") 592 | if self.config.getboolean('DISCORD', 'ENABLE'): 593 | dis_message = (self.dis_title + " " + mode + " mode enabled.") 594 | if mode == "Approach": 595 | from defSS import get_adsbx_screenshot 596 | url_params = f"largeMode=2&hideButtons&hideSidebar&mapDim=0&zoom=10&icao={self.icao}&overlays={self.get_adsbx_map_overlays()}&limitupdates=0" 597 | get_adsbx_screenshot(self.map_file_name, url_params, overrides=self.overrides, conceal_ac_id=self.conceal_ac_id, conceal_pia=self.conceal_pia) 598 | sendDis(dis_message, self.config, None, self.map_file_name) 599 | #elif mode in ["Althold", "VNAV", "LNAV"] and self.sel_nav_alt != None: 600 | # sendDis((dis_message + ", Sel Alt. " + str(self.sel_nav_alt) + ", Current Alt. " + str(self.alt_ft)), self.config) 601 | else: 602 | sendDis(dis_message, self.config) 603 | #Selected Altitude 604 | if self.sel_nav_alt is not None and self.last_sel_alt is not None and self.last_sel_alt != self.sel_nav_alt: 605 | #Discord 606 | print("Nav altitude is now", self.sel_nav_alt) 607 | if self.config.getboolean('DISCORD', 'ENABLE'): 608 | dis_message = (self.dis_title + " Sel. alt. " + str("{:,} ft".format(self.sel_nav_alt))) 609 | sendDis(dis_message, self.config) 610 | #Circling 611 | if self.last_track is not None: 612 | import time 613 | if self.circle_history is None: 614 | self.circle_history = {"traces" : [], "triggered" : False} 615 | #Add touchngo 616 | if self.on_ground or self.alt_ft <= 500: 617 | self.circle_history["touchngo"] = time.time() 618 | #Add a Trace 619 | if self.on_ground is False: 620 | from calculate_headings import calculate_deg_change 621 | track_change = calculate_deg_change(self.track, self.last_track) 622 | track_change = round(track_change, 3) 623 | if self.latitude is not None and self.longitude is not None: 624 | self.circle_history["traces"].append((time.time(), self.latitude, self.longitude, track_change)) 625 | 626 | total_change = 0 627 | coords = [] 628 | for trace in self.circle_history["traces"]: 629 | total_change += float(trace[3]) 630 | coords.append((float(trace[1]), float(trace[2]))) 631 | 632 | print("Total Bearing Change", round(total_change, 3)) 633 | #Check Centroid when Bearing change meets req 634 | if abs(total_change) >= 720 and self.circle_history['triggered'] is False: 635 | print("Circling Bearing Change Met") 636 | from shapely.geometry import MultiPoint 637 | from geopy.distance import geodesic 638 | aircraft_coords = (self.latitude, self.longitude) 639 | points = MultiPoint(coords) 640 | cent = (points.centroid) #True centroid, not necessarily an existing point 641 | #rp = (points.representative_point()) #A represenative point, not centroid, 642 | print(cent) 643 | #print(rp) 644 | distance_to_centroid = round(geodesic(aircraft_coords, cent.coords).mi, 2) 645 | print(f"Distance to centroid of circling coordinates {distance_to_centroid} miles") 646 | if distance_to_centroid <= 15: 647 | print("Within 15 miles of centroid, CIRCLING") 648 | #Finds Nearest Airport 649 | from defAirport import getClosestAirport 650 | nearest_airport_dict = getClosestAirport(self.latitude, self.longitude, ["small_airport", "medium_airport", "large_airport"]) 651 | from calculate_headings import calculate_from_bearing, calculate_cardinal 652 | from_bearing = calculate_from_bearing((float(nearest_airport_dict['latitude_deg']), float(nearest_airport_dict['longitude_deg'])), (self.latitude, self.longitude)) 653 | cardinal = calculate_cardinal(from_bearing) 654 | #Finds Nearest TFR or in TFR 655 | from shapely.geometry import MultiPoint 656 | from geopy.distance import geodesic 657 | from shapely.geometry.polygon import Polygon 658 | from shapely.geometry import Point 659 | import requests, json 660 | closest_tfr = None 661 | in_tfr = None 662 | if Plane.main_config.getboolean("TFRS", "ENABLE"): 663 | tfr_url = Plane.main_config.get("TFRS", "URL") 664 | response = requests.get(tfr_url, timeout=60) 665 | tfrs = json.loads(response.text) 666 | for tfr in tfrs: 667 | if in_tfr is not None: 668 | break 669 | elif tfr['details'] is not None and 'shapes' in tfr['details'].keys(): 670 | for index, shape in enumerate(tfr['details']['shapes']): 671 | if 'txtName' not in shape.keys(): 672 | shape['txtName'] = 'shape_'+str(index) 673 | polygon = None 674 | if shape['type'] == "poly": 675 | points = shape['points'] 676 | elif shape['type'] == "circle": 677 | from functools import partial 678 | import pyproj 679 | from shapely.ops import transform 680 | from shapely.geometry import Point 681 | proj_wgs84 = pyproj.Proj('+proj=longlat +datum=WGS84') 682 | def geodesic_point_buffer(lat, lon, km): 683 | # Azimuthal equidistant projection 684 | aeqd_proj = '+proj=aeqd +lat_0={lat} +lon_0={lon} +x_0=0 +y_0=0' 685 | project = partial( 686 | pyproj.transform, 687 | pyproj.Proj(aeqd_proj.format(lat=lat, lon=lon)), 688 | proj_wgs84) 689 | buf = Point(0, 0).buffer(km * 1000) # distance in metres 690 | return transform(project, buf).exterior.coords[:] 691 | radius_km = float(shape['radius']) * 1.852 692 | b = geodesic_point_buffer(shape['lat'], shape['lon'], radius_km) 693 | points = [] 694 | for coordinate in b: 695 | points.append([coordinate[1], coordinate[0]]) 696 | elif shape['type'] in ["polyarc", "polyexclude"]: 697 | points = shape['all_points'] 698 | aircraft_location = Point(self.latitude, self.longitude) 699 | if polygon is None: 700 | polygon = Polygon(points) 701 | if polygon.contains(aircraft_location): 702 | in_tfr = {'info': tfr, 'closest_shape_name' : shape['txtName']} 703 | break 704 | else: 705 | point_dists = [] 706 | for point in points: 707 | from geopy.distance import geodesic 708 | point = tuple(point) 709 | point_dists.append(float((geodesic((self.latitude, self.longitude), point).mi))) 710 | distance = min(point_dists) 711 | if closest_tfr is None: 712 | closest_tfr = {'info': tfr, 'closest_shape_name' : shape['txtName'], 'distance' : round(distance)} 713 | elif distance < closest_tfr['distance']: 714 | closest_tfr = {'info': tfr, 'closest_shape_name' : shape['txtName'], 'distance' : round(distance)} 715 | if in_tfr is not None: 716 | for shape in in_tfr['info']['details']['shapes']: 717 | if shape['txtName'] == in_tfr['closest_shape_name']: 718 | valDistVerUpper, valDistVerLower = int(shape['valDistVerUpper']), int(shape['valDistVerLower']) 719 | print("In TFR based off location checking alt next", in_tfr) 720 | break 721 | if not (self.alt_ft >= valDistVerLower and self.alt_ft <= valDistVerUpper): 722 | if self.alt_ft > valDistVerUpper: 723 | in_tfr['context'] = "above" 724 | elif self.alt_ft < valDistVerLower: 725 | in_tfr['context'] = "below" 726 | print("But not in alt of TFR", in_tfr['context']) 727 | 728 | if in_tfr is None: 729 | print("Closest TFR", closest_tfr) 730 | #Generate Map 731 | import staticmaps 732 | context = staticmaps.Context() 733 | context.set_tile_provider(staticmaps.tile_provider_OSM) 734 | if in_tfr is not None: 735 | shapes = in_tfr['info']['details']['shapes'] 736 | else: 737 | shapes = closest_tfr['info']['details']['shapes'] 738 | def draw_poly(context, pairs): 739 | pairs.append(pairs[0]) 740 | context.add_object( 741 | staticmaps.Area( 742 | [staticmaps.create_latlng(lat, lng) for lat, lng in pairs], 743 | fill_color=staticmaps.parse_color("#FF000033"), 744 | width=2, 745 | color=staticmaps.parse_color("#8B0000"), 746 | ) 747 | ) 748 | return context 749 | for shape in shapes: 750 | if shape['type'] == "poly": 751 | pairs = shape['points'] 752 | context = draw_poly(context, pairs) 753 | elif shape['type'] == "polyarc" or shape['type'] == "polyexclude": 754 | pairs = shape['all_points'] 755 | context = draw_poly(context, pairs) 756 | elif shape['type'] =="circle": 757 | center = [shape['lat'], shape['lon']] 758 | center1 = staticmaps.create_latlng(center[0], center[1]) 759 | context.add_object(staticmaps.Circle(center1, (float(shape['radius']) * 1.852), fill_color=staticmaps.parse_color("#FF000033"), color=staticmaps.parse_color("#8B0000"), width=2)) 760 | context.add_object(staticmaps.Marker(center1, color=staticmaps.RED)) 761 | def tfr_image(context, aircraft_coords): 762 | from PIL import Image 763 | heading = self.track 764 | heading *= -1 765 | im = Image.open('./dependencies/ac.png') 766 | im_rotate = im.rotate(heading, resample=Image.BICUBIC) 767 | import tempfile 768 | rotated_file = f"{tempfile.gettempdir()}/rotated_ac.png" 769 | im_rotate.save(rotated_file) 770 | pos = staticmaps.create_latlng(aircraft_coords[0], aircraft_coords[1]) 771 | marker = staticmaps.ImageMarker(pos, rotated_file, origin_x=35, origin_y=35) 772 | context.add_object(marker) 773 | image = context.render_cairo(1000, 1000) 774 | os.remove(rotated_file) 775 | tfr_map_filename = f"{tempfile.gettempdir()}/{self.icao}_TFR_.png" 776 | image.write_to_png(tfr_map_filename) 777 | return tfr_map_filename 778 | 779 | from defSS import get_adsbx_screenshot 780 | url_params = f"largeMode=2&hideButtons&hideSidebar&mapDim=0&zoom=10&icao={self.icao}&overlays={self.get_adsbx_map_overlays()}&limitupdates=0" 781 | get_adsbx_screenshot(self.map_file_name, url_params, overrides=self.overrides, conceal_ac_id=self.conceal_ac_id, conceal_pia=self.conceal_pia) 782 | if nearest_airport_dict['distance_mi'] < 3: 783 | if "touchngo" in self.circle_history.keys(): 784 | message = f"Doing touch and goes at {nearest_airport_dict['icao']}" 785 | else: 786 | message = f"Circling over {nearest_airport_dict['icao']} at {self.alt_ft}ft." 787 | else: 788 | message = f"Circling {round(nearest_airport_dict['distance_mi'], 2)}mi {cardinal} of {nearest_airport_dict['icao']}, {nearest_airport_dict['name']} at {self.alt_ft}ft. " 789 | tfr_map_filename = None 790 | if in_tfr is not None: 791 | wording_context = "Inside" if 'context' not in in_tfr.keys() else "Above" if in_tfr['context'] == 'above' else "Below" 792 | message += f" {wording_context} TFR {in_tfr['info']['NOTAM']}, a TFR for {in_tfr['info']['Type'].title()}" 793 | tfr_map_filename = tfr_image(context, (self.latitude, self.longitude)) 794 | elif in_tfr is None and closest_tfr is not None and "distance" in closest_tfr.keys() and closest_tfr["distance"] <= 20: 795 | message += f" {closest_tfr['distance']} miles from TFR {closest_tfr['info']['NOTAM']}, a TFR for {closest_tfr['info']['Type']}" 796 | tfr_map_filename = tfr_image(context, (self.latitude, self.longitude)) 797 | elif in_tfr is None and closest_tfr is not None and "distance" not in closest_tfr.keys(): 798 | message += f" near TFR {closest_tfr['info']['NOTAM']}, a TFR for {closest_tfr['info']['Type']}" 799 | raise Exception(message) 800 | 801 | print(message) 802 | #Telegram 803 | if self.config.has_section('TELEGRAM') and self.config.getboolean('TELEGRAM', 'ENABLE'): 804 | photo = open(self.map_file_name, "rb") 805 | from defTelegram import sendTeleg 806 | sendTeleg(photo, message, self.config) 807 | if self.config.getboolean('DISCORD', 'ENABLE'): 808 | role_id = self.config.get('DISCORD', 'ROLE_ID') if self.config.has_option('DISCORD', 'ROLE_ID') and self.config.get('DISCORD', 'ROLE_ID').strip() != "" else None 809 | if tfr_map_filename is not None: 810 | sendDis(message, self.config, role_id, self.map_file_name, tfr_map_filename) 811 | elif tfr_map_filename is None: 812 | sendDis(message, self.config, role_id, self.map_file_name) 813 | if self.config.getboolean('TWITTER', 'ENABLE') and Plane.main_config.getboolean('TWITTER', 'ENABLE'): 814 | twitter_media_map_obj = self.tweet_api.media_upload(self.map_file_name) 815 | media_ids = [twitter_media_map_obj.media_id] 816 | if tfr_map_filename is not None: 817 | twitter_media_tfr_map_obj = self.tweet_api.media_upload(tfr_map_filename) 818 | media_ids.append(twitter_media_tfr_map_obj.media_id) 819 | elif tfr_map_filename is None: 820 | print("No TFR Map") 821 | tweet = f"{self.twitter_title} {message}".strip() 822 | self.tweet_api.update_status(status = tweet, media_ids=media_ids) 823 | #Meta 824 | if self.config.has_option('META', 'ENABLE') and self.config.getboolean('META', 'ENABLE'): 825 | from meta_toolkit import post_to_meta_both 826 | post_to_meta_both(self.config.get("META", "FB_PAGE_ID"), self.config.get("META", "IG_USER_ID"), self.map_file_name, message, self.config.get("META", "ACCESS_TOKEN")) 827 | #Mastodon 828 | if self.config.has_section('MASTODON') and self.config.getboolean('MASTODON', 'ENABLE'): 829 | from defMastodon import sendMastodon 830 | sendMastodon(self.map_file_name, message, self.config) 831 | self.circle_history['triggered'] = True 832 | elif abs(total_change) <= 360 and self.circle_history["triggered"]: 833 | print("No Longer Circling, trigger cleared") 834 | self.circle_history['triggered'] = False 835 | # #Power Up 836 | # if self.last_feeding == False and self.speed == 0 and self.on_ground: 837 | # if self.config.getboolean('DISCORD', 'ENABLE'): 838 | # dis_message = (self.dis_title + "Powered Up").strip() 839 | # sendDis(dis_message, self.config) 840 | 841 | 842 | #Set Variables to compare to next check 843 | self.last_track = self.track 844 | self.last_feeding = self.feeding 845 | self.last_on_ground = self.on_ground 846 | self.last_below_desired_ft = self.below_desired_ft 847 | self.last_longitude = self.longitude 848 | self.last_latitude = self.latitude 849 | self.last_nav_modes = self.nav_modes 850 | self.last_sel_alt = self.sel_nav_alt 851 | 852 | 853 | if self.takeoff_time != None: 854 | elapsed_time = datetime.utcnow() - self.takeoff_time 855 | hours, remainder = divmod(elapsed_time.total_seconds(), 3600) 856 | minutes, seconds = divmod(remainder, 60) 857 | print((f"Time Since Take off {int(hours)} Hours : {int(minutes)} Mins : {int(seconds)} Secs")) 858 | self.print_header("END") 859 | def check_new_ras(self, ras): 860 | for ra in ras: 861 | if self.recent_ra_types == {} or ra['acas_ra']['advisory'] not in self.recent_ra_types.keys(): 862 | self.recent_ra_types[ra['acas_ra']['advisory']] = ra['acas_ra']['unix_timestamp'] 863 | ra_message = f"TCAS Resolution Advisory: {ra['acas_ra']['advisory']}" 864 | if ra['acas_ra']['advisory_complement'] != "": 865 | ra_message += f", {ra['acas_ra']['advisory_complement']}" 866 | if bool(int(ra['acas_ra']['MTE'])): 867 | ra_message += ", Multi threat" 868 | from defSS import get_adsbx_screenshot, generate_adsbx_screenshot_time_params 869 | url_params = f"&lat={ra['lat']}&lon={ra['lon']}&zoom=11&largeMode=2&hideButtons&hideSidebar&mapDim=0&overlays={self.get_adsbx_map_overlays()}&limitupdates=0" 870 | if "threat_id_hex" in ra['acas_ra'].keys(): 871 | from mictronics_parse import get_aircraft_reg_by_icao 872 | threat_reg = get_aircraft_reg_by_icao(ra['acas_ra']['threat_id_hex']) 873 | threat_id = threat_reg if threat_reg is not None else "ICAO: " + ra['acas_ra']['threat_id_hex'] 874 | ra_message += f", invader: {threat_id}" 875 | url_params += generate_adsbx_screenshot_time_params(ra['acas_ra']['unix_timestamp']) + f"&icao={ra['acas_ra']['threat_id_hex']},{self.icao.lower()}×tamp={ra['acas_ra']['unix_timestamp']}" 876 | else: 877 | url_params += f"&icao={self.icao.lower()}&noIsolation" 878 | print(url_params) 879 | get_adsbx_screenshot(self.map_file_name, url_params, True, True, overrides=self.overrides, conceal_ac_id=self.conceal_ac_id, conceal_pia=self.conceal_pia) 880 | 881 | if self.config.getboolean('DISCORD', 'ENABLE'): 882 | from defDiscord import sendDis 883 | dis_message = f"{self.dis_title} {ra_message}" 884 | role_id = self.config.get('DISCORD', 'ROLE_ID') if self.config.has_option('DISCORD', 'ROLE_ID') and self.config.get('DISCORD', 'ROLE_ID').strip() != "" else None 885 | sendDis(dis_message, self.config, role_id, self.map_file_name) 886 | #if twitter 887 | def expire_ra_types(self): 888 | if self.recent_ra_types != {}: 889 | for ra_type, postime in self.recent_ra_types.copy().items(): 890 | timestamp = datetime.fromtimestamp(postime) 891 | time_since_ra = datetime.now() - timestamp 892 | print(time_since_ra) 893 | if time_since_ra.seconds >= 600: 894 | print(ra_type) 895 | self.recent_ra_types.pop(ra_type) 896 | --------------------------------------------------------------------------------