This commit is contained in:
doms9 2025-09-30 18:11:17 -04:00
parent a0176c303d
commit 00000d9cc3
3 changed files with 5 additions and 134 deletions

View file

@ -134,7 +134,8 @@ async def refresh_html_cache(client: httpx.AsyncClient, url: str) -> dict[str, s
"sport": sport,
"event": event,
"link": f"https://streamed.site/set.php?{m[1]}",
"ts": event_dt.timestamp(),
"event_ts": event_dt.timestamp(),
"timestamp": now.timestamp(),
}
return events
@ -146,7 +147,7 @@ async def get_events(
cached_keys: set[str],
) -> list[dict[str, str]]:
if not (events := load_cache(HTML_CACHE, exp=10_800)):
if not (events := load_cache(HTML_CACHE, exp=86_400)):
events = await refresh_html_cache(client, url)
write_cache(HTML_CACHE, events)
@ -158,7 +159,7 @@ async def get_events(
if cached_keys & {k}:
continue
if not start_ts <= v["ts"] < end_ts:
if not start_ts <= v["event_ts"] < end_ts:
continue
live.append({**v})