update M3U8
This commit is contained in:
parent
d846c59f5e
commit
5f7a533e07
5 changed files with 471 additions and 157 deletions
|
|
@ -268,8 +268,9 @@ async def get_events(
|
|||
|
||||
async def scrape(client: httpx.AsyncClient) -> None:
|
||||
cached_urls = CACHE_FILE.load()
|
||||
cached_count = len(cached_urls)
|
||||
urls.update({k: v for k, v in cached_urls.items() if v["url"]})
|
||||
valid_urls = {k: v for k, v in cached_urls.items() if v["url"]}
|
||||
cached_count = len(valid_urls)
|
||||
urls.update(valid_urls)
|
||||
|
||||
log.info(f"Loaded {cached_count} event(s) from cache")
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ async def refresh_api_cache(
|
|||
r = await client.get(url)
|
||||
r.raise_for_status()
|
||||
except Exception as e:
|
||||
log.error(f'Failed to fetch "{url}"\n{e}')
|
||||
log.error(f'Failed to fetch "{url}": {e}')
|
||||
return {}
|
||||
|
||||
return r.json()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue