From 7cfb45d2b13361bac23433a6234e345f926d9fc2 Mon Sep 17 00:00:00 2001 From: Kelly Date: Fri, 27 Feb 2026 12:56:22 -0800 Subject: [PATCH] Update locationdata.py hope to have resolved this https://github.com/SpudGunMan/meshing-around/issues/285 --- modules/locationdata.py | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/modules/locationdata.py b/modules/locationdata.py index 88a94b8..3a9efe3 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -99,25 +99,9 @@ def getRepeaterBook(lat=0, lon=0): logger.error(f"Location:Error fetching repeater data from {repeater_url} with status code {response.status_code}") return my_settings.ERROR_FETCHING_DATA - # Detect Cloudflare / bot-check pages or other anti-bot responses by looking - # for known phrases that indicate a challenge page instead of the expected HTML table. - try: - lowered = response.text.lower() - except Exception: - lowered = '' - cloudflare_signs = ( - "checking your browser", - "please enable javascript", - "just a moment", - "cf-chl-bypass", - "attention required", - ) - if any(sig in lowered for sig in cloudflare_signs): - logger.warning("Location: Cloudflare/bot-check detected when fetching repeater data") - return my_settings.ERROR_FETCHING_DATA - soup = bs.BeautifulSoup(response.text, 'html.parser') - table = soup.find('table', attrs={'class': 'table table-striped table-hover align-middle sortable'}) + # match the repeater table by presence of the "sortable" class (class order/extra classes may vary) + table = soup.select_one('table.sortable') if table is not None: cells = table.find_all('td') data = []