e
This commit is contained in:
parent
00000d98b2
commit
00000d9449
5 changed files with 17 additions and 18 deletions
|
|
@ -4,7 +4,7 @@ from pathlib import Path
|
|||
|
||||
import httpx
|
||||
|
||||
from .utils import LOGOS, get_logger, load_cache
|
||||
from .utils import LOGOS, get_logger, load_cache, now
|
||||
|
||||
log = get_logger(__name__)
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ async def fetch_m3u8(client: httpx.AsyncClient) -> list[str]:
|
|||
|
||||
|
||||
async def main(client: httpx.AsyncClient) -> None:
|
||||
if cached := load_cache(CACHE_FILE, hour=12):
|
||||
if cached := load_cache(CACHE_FILE, exp=86400):
|
||||
urls.update(cached)
|
||||
log.info(f"Collected {len(urls)} event(s) from cache")
|
||||
return
|
||||
|
|
@ -57,6 +57,7 @@ async def main(client: httpx.AsyncClient) -> None:
|
|||
sport,
|
||||
"https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png",
|
||||
),
|
||||
"timestamp": now.timestamp(),
|
||||
}
|
||||
|
||||
CACHE_FILE.write_text(json.dumps(urls, indent=2), encoding="utf-8")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue