This commit is contained in:
doms9 2025-09-15 09:26:20 -04:00
parent 856ddda848
commit 00000d9186
10 changed files with 36 additions and 440 deletions

View file

@ -1,11 +1,18 @@
import json
from pathlib import Path
from urllib.parse import unquote, urljoin
import httpx
from selectolax.parser import HTMLParser
from .utils import LOGOS, get_base, get_logger, load_cache, now, safe_process_event
from .utils import (
LOGOS,
get_base,
get_logger,
load_cache,
now,
safe_process_event,
write_cache,
)
log = get_logger(__name__)
@ -122,6 +129,7 @@ async def main(client: httpx.AsyncClient) -> None:
if not (base_url := await get_base(client, MIRRORS)):
log.warning("No working FSTV mirrors")
write_cache(CACHE_FILE, cached_urls)
return
events = await get_events(
@ -165,4 +173,4 @@ async def main(client: httpx.AsyncClient) -> None:
else:
log.info("No new events found")
CACHE_FILE.write_text(json.dumps(cached_urls, indent=2), encoding="utf-8")
write_cache(CACHE_FILE, cached_urls)