From 1bc5b65ca4450e73ed91135c8608c0125c290cfb Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Sun, 6 Dec 2020 09:25:14 -0500 Subject: [PATCH] test --- data/internal_config/ZZ_serviceconf.json | 10 ++++++++++ fHDHR/origin/origin_service.py | 9 ++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/data/internal_config/ZZ_serviceconf.json b/data/internal_config/ZZ_serviceconf.json index 1da7995..623579f 100644 --- a/data/internal_config/ZZ_serviceconf.json +++ b/data/internal_config/ZZ_serviceconf.json @@ -65,6 +65,16 @@ "value": false, "config_file": true, "config_web": true + }, + "geoID":{ + "value": "none", + "config_file": true, + "config_web": false + }, + "geoLST":{ + "value": "none", + "config_file": true, + "config_web": false } } } diff --git a/fHDHR/origin/origin_service.py b/fHDHR/origin/origin_service.py index 469a8d8..3b62151 100644 --- a/fHDHR/origin/origin_service.py +++ b/fHDHR/origin/origin_service.py @@ -28,17 +28,20 @@ class OriginService(): return True def getID(self): + if self.fhdhr.config.dict["main"]["origin"]["geoID"] and self.fhdhr.config.dict["main"]["origin"]["geoLST"]: + geoID = self.fhdhr.config.dict["main"]["origin"]["geoID"] + geoLST = self.fhdhr.config.dict["main"]["origin"]["geoLST"] + return geoID, geoLST + try: url_headers = {'User-Agent': 'Mozilla/5.0'} pagereq = self.fhdhr.web.session.get(self.base_url, headers=url_headers).text results = json.loads(re.findall('__JOBS_REHYDRATE_STATE__=(.+?);', (pagereq), flags=re.DOTALL)[0]) geoID, geoLST = results["jobs"]["1"]["data"]["geoId"], results["jobs"]["1"]["data"]["channelListId"] except Exception as e: - self.fhdhr.logger.warning("XUMO Setup Failed %s" % e) + self.fhdhr.logger.warning("XUMO Setup Failed: %s" % e) return None, None - print(geoID + " " + geoLST) - return geoID, geoLST def get_status_dict(self):