From 00000d9f373c17142888a2e9b72b6aa4b7966a71 Mon Sep 17 00:00:00 2001 From: doms9 <96013514+doms9@users.noreply.github.com> Date: Mon, 6 Oct 2025 19:53:10 -0400 Subject: [PATCH] e --- M3U8/fetch.py | 2 +- M3U8/scrapers/utils/config.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/M3U8/fetch.py b/M3U8/fetch.py index 43e719e..9a17174 100644 --- a/M3U8/fetch.py +++ b/M3U8/fetch.py @@ -35,7 +35,7 @@ async def main() -> None: asyncio.create_task(tvpass.scrape(network.client)), ] - await asyncio.gather(*tasks, return_exceptions=True) + await asyncio.gather(*tasks) additions = ( fstv.urls diff --git a/M3U8/scrapers/utils/config.py b/M3U8/scrapers/utils/config.py index 6f02fc3..4b50824 100644 --- a/M3U8/scrapers/utils/config.py +++ b/M3U8/scrapers/utils/config.py @@ -36,13 +36,13 @@ class Time(datetime): @classmethod def from_str(cls, s: str, fmt: str | None = None) -> "Time": - pattern = r"\b(ET|UTC|EST|EDT)\b" + pattern = re.compile(r"\b(ET|UTC|EST|EDT)\b") - match = re.search(pattern, s) + match = pattern.search(s) tz = ZONES.get(match[1]) if match else cls.TZ - cleaned_str = re.sub(pattern, "", s).strip() + cleaned_str = pattern.sub("", s).strip() if fmt: dt = datetime.strptime(cleaned_str, fmt) @@ -99,8 +99,10 @@ class Leagues: return (None, self.live_img) def is_valid(self, event: str, league: str) -> bool: - if match := re.search(r"(\-|vs.?|at)", event): - t1, t2 = event.split(match[1]) + pattern = re.compile(r"\s+(?:-|vs\.?|at)\s+", flags=re.IGNORECASE) + + if pattern.search(event): + t1, t2 = re.split(pattern, event) return any(t in self.teams(league) for t in (t1.strip(), t2.strip()))