e
This commit is contained in:
parent
4f6e1caa5f
commit
00000d9c6d
16 changed files with 106 additions and 89 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import asyncio
|
||||
import re
|
||||
from functools import partial
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
from urllib.parse import urljoin
|
||||
|
||||
|
|
@ -14,9 +13,9 @@ log = get_logger(__name__)
|
|||
|
||||
urls: dict[str, dict[str, str | float]] = {}
|
||||
|
||||
API_FILE = Cache(Path(__file__).parent / "caches" / "strmd_api.json", exp=28_800)
|
||||
CACHE_FILE = Cache("strmd.json", exp=10_800)
|
||||
|
||||
CACHE_FILE = Cache(Path(__file__).parent / "caches" / "strmd.json", exp=10_800)
|
||||
API_FILE = Cache("strmd-api.json", exp=28_800)
|
||||
|
||||
MIRRORS = ["https://streamed.pk", "https://streami.su", "https://streamed.st"]
|
||||
|
||||
|
|
@ -41,6 +40,7 @@ async def refresh_api_cache(
|
|||
r.raise_for_status()
|
||||
except Exception as e:
|
||||
log.error(f'Failed to fetch "{url}": {e}')
|
||||
|
||||
return {}
|
||||
|
||||
data = r.json()
|
||||
|
|
@ -130,7 +130,7 @@ async def get_events(
|
|||
|
||||
API_FILE.write(api_data)
|
||||
|
||||
events: list[dict[str, str]] = []
|
||||
events = []
|
||||
|
||||
now = Time.clean(Time.now())
|
||||
start_dt = now.delta(minutes=-30)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue