diff --git a/M3U8/scrapers/streameast.py b/M3U8/scrapers/streameast.py index 59760f1..879fea5 100644 --- a/M3U8/scrapers/streameast.py +++ b/M3U8/scrapers/streameast.py @@ -111,7 +111,10 @@ async def get_events( continue for a in section.css("a.uefa-card"): - href = urljoin(url, a.attributes.get("href", "")) + if not (href := a.attributes.get("href")): + continue + + link = urljoin(url, href) team_spans = [t.text(strip=True) for t in a.css("span.uefa-name")] @@ -129,7 +132,7 @@ async def get_events( time_text = time_span.text(strip=True) - timestamp = int(time_span.attributes.get("data-time", 31496400)) + timestamp = int(a.attributes.get("data-time", 31496400)) key = f"[{sport}] {name} (SEAST)" @@ -143,7 +146,7 @@ async def get_events( { "sport": sport, "event": name, - "link": href, + "link": link, "timestamp": timestamp, } )