This commit is contained in:
doms9 2025-12-19 14:05:41 -05:00
parent 8ac6ca8360
commit 00000d94e3
2 changed files with 4 additions and 4 deletions

View file

@ -57,7 +57,7 @@ async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
if not (html_data := await network.request(BASE_URL, log=log)): if not (html_data := await network.request(BASE_URL, log=log)):
return events return events
pattern = re.compile(r"^(?:LIVE|\d+\s+(minutes?)\b)", re.IGNORECASE) pattern = re.compile(r"^(?:LIVE|(?:[1-9]|[12]\d|30)\s+minutes?\b)", re.IGNORECASE)
soup = HTMLParser(html_data.content) soup = HTMLParser(html_data.content)

View file

@ -76,6 +76,8 @@ async def process_event(
context: BrowserContext, context: BrowserContext,
) -> str | None: ) -> str | None:
pattern = re.compile(r"\((\d+)\)")
page = await context.new_page() page = await context.new_page()
captured: list[str] = [] captured: list[str] = []
@ -111,9 +113,7 @@ async def process_event(
return return
match = re.search(r"\((\d+)\)", text) if not (match := pattern.search(text)) or int(match[1]) == 0:
if not match or int(match[1]) == 0:
log.warning(f"URL {url_num}) No available stream links.") log.warning(f"URL {url_num}) No available stream links.")
return return