add streamhub
rename cache files
This commit is contained in:
doms9 2025-12-13 16:57:14 -05:00
parent 4d72d60227
commit 00000d930e
18 changed files with 230 additions and 112 deletions

View file

@ -13,9 +13,11 @@ log = get_logger(__name__)
urls: dict[str, dict[str, str | float]] = {}
CACHE_FILE = Cache("streamsgate.json", exp=10_800)
TAG = "STRMSG8"
API_FILE = Cache("streamsgate-api.json", exp=28_800)
CACHE_FILE = Cache(f"{TAG.lower()}.json", exp=10_800)
API_FILE = Cache(f"{TAG.lower()}-api.json", exp=28_800)
BASE_URL = "https://streamingon.org"
@ -31,8 +33,6 @@ SPORT_ENDPOINTS = [
"f1",
]
TAG = "STRMSG8"
def get_event(t1: str, t2: str) -> str:
match t1:
@ -94,8 +94,8 @@ async def get_events(
events = []
start_dt = now.delta(minutes=-30)
end_dt = now.delta(minutes=30)
start_dt = now.delta(hours=-1)
end_dt = now.delta(minutes=10)
for stream_group in api_data:
event_ts = stream_group.get("ts")