cfg json bullcrap

This commit is contained in:
2025-01-28 17:41:50 -06:00
parent 63e79c5a4c
commit 4afc4b3ad0
19 changed files with 26 additions and 24 deletions

View File

@@ -24,12 +24,12 @@ async def getValidTimestamps(radarType:str) -> list:
async with aiohttp.ClientSession() as s:
if (radarType == "satrad"):
maxImages = 12
url = "https://api.weather.com/v3/TileServer/series/productSet?apiKey=" + cfg[twcApiKey] + "&filter=satrad"
url = "https://api.weather.com/v3/TileServer/series/productSet?apiKey=" + cfg["twcApiKey"] + "&filter=satrad"
series = 'satrad'
elif (radarType == "radarmosaic"):
maxImages = 36
url = "https://api.weather.com/v3/TileServer/series/productSet?apiKey=" + cfg[twcApiKey] + "&filter=twcRadarMosaic"
url = "https://api.weather.com/v3/TileServer/series/productSet?apiKey=" + cfg["twcApiKey"] + "&filter=twcRadarMosaic"
series = 'twcRadarMosaic'
else:
@@ -52,9 +52,9 @@ async def downloadRadarFrames(radarType:str, timestamps: list) -> list:
imagesToSend = []
if (radarType == "satrad"):
url_root = cfg[radarBaseUrl]
url_root = cfg["radarBaseUrl"]
elif (radarType == "radarmosaic"):
url_root = cfg[radarBaseUrl]
url_root = cfg["radarBaseUrl"]
else:
l.error(f'Invalid radar type "{radarType}" -- Valid radar types include "satrad", "radarmosaic"')
return

View File

@@ -38,7 +38,7 @@ async def getValidTimestamps(boundaries:ImageBoundaries) -> list:
times = []
async with aiohttp.ClientSession() as session:
url = "https://api.weather.com/v3/TileServer/series/productSet?apiKey=" + cfg[twcApiKey] + "&filter=twcRadarMosaic"
url = "https://api.weather.com/v3/TileServer/series/productSet?apiKey=" + cfg["twcApiKey"] + "&filter=twcRadarMosaic"
async with session.get(url) as r:
response = await r.json()

View File

@@ -19,7 +19,7 @@ async def getValidTimestamps(boundaries:ImageBoundaries) -> list:
times = []
async with aiohttp.ClientSession() as session:
url = "https://api.weather.com/v3/TileServer/series/productSet?apiKey=" + cfg[twcApiKey] + "&filter=twcRadarMosaic"
url = "https://api.weather.com/v3/TileServer/series/productSet?apiKey=" + cfg["twcApiKey"] + "&filter=twcRadarMosaic"
async with session.get(url) as r:
response = await r.json()