This commit is contained in:
doms9 2025-09-24 16:21:25 -04:00
parent 56e0a3b9de
commit 00000d9bd1
4 changed files with 13 additions and 12 deletions

View file

@ -59,7 +59,7 @@ def get_tvg(sport: str, event: str) -> str | None:
return "Basketball.Dummy.us" return "Basketball.Dummy.us"
case _: case _:
return return leagues.info(sport)[0]
async def refresh_api_cache( async def refresh_api_cache(
@ -218,13 +218,13 @@ async def scrape(client: httpx.AsyncClient) -> None:
) )
if url: if url:
sport, event = ev["sport"], ev["event"] sport, event, logo = ev["sport"], ev["event"], ev["logo"]
key = f"[{sport}] {event} (PPV)" key = f"[{sport}] {event} (PPV)"
entry = { entry = {
"url": url, "url": url,
"logo": ev["logo"], "logo": logo,
"base": base_url, "base": base_url,
"timestamp": now.timestamp(), "timestamp": now.timestamp(),
"id": get_tvg(sport, event) or "Live.Event.us", "id": get_tvg(sport, event) or "Live.Event.us",

View file

@ -54,10 +54,6 @@ async def get_events(client: httpx.AsyncClient) -> list[dict[str, str]]:
events = [] events = []
for card in soup.css("div.container div.card"): for card in soup.css("div.container div.card"):
img = card.css_first("img.league-logo")
logo = img.attrs.get("src") if img else None
sport = card.css_first("h5.card-title").text(strip=True) sport = card.css_first("h5.card-title").text(strip=True)
name = card.css_first("p.card-text").text(strip=True) name = card.css_first("p.card-text").text(strip=True)
@ -70,7 +66,6 @@ async def get_events(client: httpx.AsyncClient) -> list[dict[str, str]]:
"sport": sport, "sport": sport,
"event": name, "event": name,
"link": urljoin(BASE_URL, href), "link": urljoin(BASE_URL, href),
"logo": logo,
} }
) )
@ -105,7 +100,7 @@ async def scrape(client: httpx.AsyncClient) -> None:
entry = { entry = {
"url": url, "url": url,
"logo": ev["logo"] or logo, "logo": logo,
"base": BASE_URL, "base": BASE_URL,
"timestamp": now.timestamp(), "timestamp": now.timestamp(),
"id": tvg_id or "Live.Event.us", "id": tvg_id or "Live.Event.us",

View file

@ -187,8 +187,8 @@ async def scrape(client: httpx.AsyncClient) -> None:
tvg_id, logo = leagues.info(sport) tvg_id, logo = leagues.info(sport)
if sport == "NBA" and leagues.is_valid(event, "WNBA"): if sport == "NBA" and leagues.is_valid(event, "WNBA"):
sport, tvg_id = "WNBA", "WNBA.dummy.us" sport = "WNBA"
logo = leagues.info("WNBA")[1] tvg_id, logo = leagues.info("WNBA")
key = f"[{sport}] {event} (SEAST)" key = f"[{sport}] {event} (SEAST)"

View file

@ -258,7 +258,7 @@
{ {
"EREDIVISIE": { "EREDIVISIE": {
"logo": "https://a.espncdn.com/combiner/i?img=/i/leaguelogos/soccer/500/11.png", "logo": "https://a.espncdn.com/combiner/i?img=/i/leaguelogos/soccer/500/11.png",
"names": ["VRIENDENLOTERIJ EREDIVISIE"] "names": ["NETHERLANDS EREDIVISIE", "VRIENDENLOTERIJ EREDIVISIE"]
} }
}, },
{ {
@ -301,6 +301,12 @@
"names": ["GOOGLE PIXEL FRAUEN-BUNDESLIGA", "WOMEN'S FEDERAL LEAGUE"] "names": ["GOOGLE PIXEL FRAUEN-BUNDESLIGA", "WOMEN'S FEDERAL LEAGUE"]
} }
}, },
{
"GREECE CUP": {
"logo": "https://i.gyazo.com/f80306df9b94a90f991b3cce386dc2b5.png",
"names": ["BETSSON GREECE UP", "GREEK CUP", "GREEK FOOTBALL CUP"]
}
},
{ {
"J1 LEAGUE": { "J1 LEAGUE": {
"logo": "https://a.espncdn.com/combiner/i?img=/i/leaguelogos/soccer/500/2199.png", "logo": "https://a.espncdn.com/combiner/i?img=/i/leaguelogos/soccer/500/2199.png",