e
This commit is contained in:
parent
a979f0bf75
commit
00000d97a5
8 changed files with 40 additions and 29 deletions
|
|
@ -48,11 +48,12 @@ async def process_event(
|
|||
re.IGNORECASE,
|
||||
)
|
||||
|
||||
if match := valid_m3u8.search(r.text):
|
||||
log.info(f"URL {url_num}) Captured M3U8")
|
||||
return match[1]
|
||||
if not (match := valid_m3u8.search(r.text)):
|
||||
log.info(f"URL {url_num}) No M3U8 found")
|
||||
return
|
||||
|
||||
log.info(f"URL {url_num}) No M3U8 found")
|
||||
log.info(f"URL {url_num}) Captured M3U8")
|
||||
return match[1]
|
||||
|
||||
|
||||
async def refresh_html_cache(
|
||||
|
|
@ -62,8 +63,6 @@ async def refresh_html_cache(
|
|||
now_ts: float,
|
||||
) -> dict[str, dict[str, str | float]]:
|
||||
|
||||
log.info("Refreshing HTML cache")
|
||||
|
||||
try:
|
||||
r = await client.get(url)
|
||||
r.raise_for_status()
|
||||
|
|
@ -116,6 +115,8 @@ async def get_events(
|
|||
now = Time.clean(Time.now())
|
||||
|
||||
if not (events := HTML_CACHE.load()):
|
||||
log.info("Refreshing HTML cache")
|
||||
|
||||
tasks = [
|
||||
refresh_html_cache(
|
||||
client,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue