e
This commit is contained in:
parent
856ddda848
commit
00000d9186
10 changed files with 36 additions and 440 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue