This commit is contained in:
doms9 2025-09-28 11:28:28 -04:00
parent 66667e9cbf
commit 00000d9956

View file

@ -117,21 +117,29 @@ async def get_events(
start_dt = now - timedelta(minutes=30)
end_dt = now + timedelta(minutes=30)
for li in soup.css("li.f1-podium--item"):
a = li.css_first("a.f1-podium--link")
if not a:
for section in soup.css("div.se-sport-section"):
if not (sport := section.attributes.get("data-sport-name", "").strip()):
continue
for a in section.css("a.uefa-card"):
href = urljoin(url, a.attributes.get("href", ""))
sport = a.css_first(".MacBaslikKat").text(strip=True)
team_spans = [t.text(strip=True) for t in a.css("span.uefa-name")]
name = a.css_first(".MacIsimleri").text(strip=True)
if len(team_spans) == 2:
name = f"{team_spans[0]} vs {team_spans[1]}"
elif len(team_spans) == 1:
name = team_spans[0]
else:
continue
if not (time_span := a.css_first(".uefa-time")):
continue
time_span = a.css_first(".f1-podium--time")
time_text = time_span.text(strip=True)
timestamp = int(time_span.attributes.get("data-zaman"))
timestamp = int(time_span.attributes.get("data-time", 0))
key = f"[{sport}] {name} (SEAST)"