From a0a8df04db088b1fea8e49766e33a792ab12706e Mon Sep 17 00:00:00 2001 From: Mark Bumiller Date: Sun, 26 Feb 2023 11:51:40 -0500 Subject: [PATCH] screenshots are now of globe.theairtraffic.com fixes Jxck-S/plane-notify#115 --- PseudoCode.md | 2 +- README.md | 4 ++-- __main__.py | 2 +- configs/mainconf.ini.example | 2 +- defSS.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PseudoCode.md b/PseudoCode.md index f19c627..5c9dcd9 100644 --- a/PseudoCode.md +++ b/PseudoCode.md @@ -4,5 +4,5 @@ - 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). - 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. - At the time of takeoff a takeoff time is set, which is referenced in the landing event to calculate approximate total flight time. -- 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. +- 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. - 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) diff --git a/README.md b/README.md index f0bcfb0..4979799 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![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) [![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)](https://opensource.org/licenses/) -Notify if configured planes have taken off or landed using Python with OpenSky(free) or ADSBExchange Data(paid but much better), outputs location of takeoff location of landing and takeoff by reverse lookup of coordinates. +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. ### Discord Output Example @@ -43,7 +43,7 @@ pipenv install ### Install Selenium / ChromeDriver or setup Google Static Maps -Selenium/ChromeDriver is used to take a screenshot of the plane on globe.adsbexchange.com. Or use Google Static Maps, which can cost money if overused(No tutorial use to get to a key). +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). #### Chrome - This is assuming linux/debian diff --git a/__main__.py b/__main__.py index b3ee4b7..0deedec 100644 --- a/__main__.py +++ b/__main__.py @@ -274,5 +274,5 @@ except Exception as e: logging.error(e) logging.error(str(traceback.format_exc())) from defDiscord import sendDis - sendDis(str("Error Exiting: " + str(e) + f"Failed on ({obj.config_path}) https://globe.adsbexchange.com/?icao={key} "), main_config, main_config.get('DISCORD', 'ROLE_ID'), "crash_latest.log") + 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") raise e diff --git a/configs/mainconf.ini.example b/configs/mainconf.ini.example index 3e57b4d..ab65c60 100644 --- a/configs/mainconf.ini.example +++ b/configs/mainconf.ini.example @@ -59,6 +59,6 @@ CONSUMER_KEY = ck CONSUMER_SECRET = cs [MAP] -#Map to create from Google Static Maps or screenshot global tar1090 from globe.adsbexchange.com +#Map to create from Google Static Maps or screenshot global tar1090 from globe.theairtraffic.com #Enter GOOGLESTATICMAP or ADSBX OPTION = ADSBX diff --git a/defSS.py b/defSS.py index ea525b3..140bc66 100644 --- a/defSS.py +++ b/defSS.py @@ -29,7 +29,7 @@ def get_adsbx_screenshot(file_path, url_params, enable_labels=False, enable_trac if platform.system() == "Linux" and os.geteuid()==0: chrome_options.add_argument('--no-sandbox') # required when running as root user. otherwise you would get no sandbox errors. browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options) - url = f"https://globe.adsbexchange.com/?{url_params}" + url = f"https://globe.theairtraffic.com/?{url_params}" print(f"Getting Screenshot of {url}") browser.set_page_load_timeout(80) browser.get(url)