From fff6d3399f434e9c2ce793e381fb46b06799d44c Mon Sep 17 00:00:00 2001 From: KittenTM Date: Thu, 26 Feb 2026 00:27:00 +0100 Subject: [PATCH] Make boss retrieval use base url instead of data --- services/boss_retrieval.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/services/boss_retrieval.py b/services/boss_retrieval.py index ca78d61..bcb0e3e 100644 --- a/services/boss_retrieval.py +++ b/services/boss_retrieval.py @@ -2,6 +2,7 @@ import subprocess import requests import oead import os +import xml.etree.ElementTree as ET from config import settings def process_boss_file(): @@ -14,8 +15,18 @@ def process_boss_file(): return False try: - boss_url = settings.boss_url - res = requests.get(boss_url, timeout=10) + master_url = settings.boss_url + print(f"data get: {master_url}") + meta_res = requests.get(master_url, timeout=10) + meta_res.raise_for_status() + root = ET.fromstring(meta_res.content) + data_url_element = root.find(".//Url") + if data_url_element is None or not data_url_element.text: + print("woops! no tag found in the XML response") + return False + real_data_url = data_url_element.text.strip() + print(f"parsed data url: {real_data_url}") + res = requests.get(real_data_url, timeout=10) res.raise_for_status() with open(temp_boss, "wb") as f: @@ -45,6 +56,9 @@ def process_boss_file(): print(f"yay! success: {output_yaml}") return True + except ET.ParseError: + print("woops! the url returned non xml... we're hanging here") + return False except Exception as e: print(f"exception {e}") return False