WWTOTA cluster support #97

This commit is contained in:
Ian Renton
2026-01-22 19:27:36 +00:00
parent 7952ad22eb
commit b62ef6a9a0
4 changed files with 27 additions and 19 deletions

View File

@@ -140,12 +140,14 @@ class LookupHelper:
# database live if possible.
def download_clublog_ctyxml(self):
try:
logging.info("Downloading Clublog cty.xml...")
logging.info("Downloading Clublog cty.xml.gz...")
response = self.CLUBLOG_CTY_XML_CACHE.get("https://cdn.clublog.org/cty.php?api=" + self.CLUBLOG_API_KEY,
headers=HTTP_HEADERS)
logging.info("Caching Clublog cty.xml.gz...")
open(self.CLUBLOG_XML_DOWNLOAD_LOCATION + ".gz", 'wb').write(response.content)
with gzip.open(self.CLUBLOG_XML_DOWNLOAD_LOCATION + ".gz", "rb") as uncompressed:
file_content = uncompressed.read()
logging.info("Caching Clublog cty.xml...")
with open(self.CLUBLOG_XML_DOWNLOAD_LOCATION, "wb") as f:
f.write(file_content)
f.flush()