mirror of
https://github.com/doms9/iptv.git
synced 2026-01-21 03:59:03 +01:00
e
fix scraper crashing if api url(s) do not work misc. edits
This commit is contained in:
parent
51598ce2a2
commit
00000d903e
9 changed files with 18 additions and 24 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import asyncio
|
||||
from functools import partial
|
||||
|
||||
from playwright.async_api import async_playwright
|
||||
|
|
@ -33,10 +32,6 @@ async def refresh_html_cache() -> dict[str, dict[str, str | float]]:
|
|||
|
||||
soup = HTMLParser(html_data.content)
|
||||
|
||||
title = soup.css_first("title").text(strip=True)
|
||||
|
||||
sport = "NFL" if "NFL" in title else "NHL"
|
||||
|
||||
date_text = now.strftime("%B %d, %Y")
|
||||
|
||||
if date_row := soup.css_first("tr.mdatetitle"):
|
||||
|
|
@ -66,10 +61,10 @@ async def refresh_html_cache() -> dict[str, dict[str, str | float]]:
|
|||
|
||||
event = fix_event(event_name)
|
||||
|
||||
key = f"[{sport}] {event} ({TAG})"
|
||||
key = f"[NHL] {event} ({TAG})"
|
||||
|
||||
events[key] = {
|
||||
"sport": sport,
|
||||
"sport": "NHL",
|
||||
"event": event,
|
||||
"link": href,
|
||||
"event_ts": event_dt.timestamp(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue