e
This commit is contained in:
parent
856ddda848
commit
00000d9186
10 changed files with 36 additions and 440 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import asyncio
|
||||
import json
|
||||
from datetime import datetime, timedelta
|
||||
from functools import partial
|
||||
from pathlib import Path
|
||||
|
|
@ -19,6 +18,7 @@ from .utils import (
|
|||
load_cache,
|
||||
now,
|
||||
safe_process_event,
|
||||
write_cache,
|
||||
)
|
||||
|
||||
log = get_logger(__name__)
|
||||
|
|
@ -162,6 +162,7 @@ async def main(client: httpx.AsyncClient) -> None:
|
|||
|
||||
if not (base_url := await get_base(client, MIRRORS)):
|
||||
log.warning("No working StreamEast mirrors")
|
||||
write_cache(CACHE_FILE, cached_urls)
|
||||
return
|
||||
|
||||
log.info(f'Scraping from "{base_url}"')
|
||||
|
|
@ -198,4 +199,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