e
This commit is contained in:
parent
00000d9766
commit
00000d950a
1 changed files with 279 additions and 279 deletions
|
|
@ -23,7 +23,7 @@ MIRRORS = ["https://streamed.pk", "https://streami.su", "https://streamed.st"]
|
|||
|
||||
def validate_category(s: str) -> str:
|
||||
if "-" in s:
|
||||
return " ".join([i.capitalize() for i in s.split("-")])
|
||||
return " ".join(i.capitalize() for i in s.split("-"))
|
||||
|
||||
elif s == "fight":
|
||||
return "Fight (UFC/Boxing)"
|
||||
|
|
@ -31,7 +31,7 @@ def validate_category(s: str) -> str:
|
|||
return s.capitalize()
|
||||
|
||||
|
||||
def get_tvg_id(sport: str, event: str) -> tuple[str | None, str]:
|
||||
def get_tvg_info(sport: str, event: str) -> tuple[str | None, str]:
|
||||
match sport:
|
||||
case "American Football":
|
||||
if leagues.is_valid(event, "NFL"):
|
||||
|
|
@ -163,6 +163,16 @@ async def get_events(
|
|||
if category == "other":
|
||||
continue
|
||||
|
||||
if not (ts := event["date"]):
|
||||
continue
|
||||
|
||||
start_ts = int(str(ts)[:-3])
|
||||
|
||||
event_dt = Time.from_ts(start_ts)
|
||||
|
||||
if not start_dt <= event_dt <= end_dt:
|
||||
continue
|
||||
|
||||
sport = validate_category(category)
|
||||
|
||||
parts = pattern.split(event["title"].strip())
|
||||
|
|
@ -175,16 +185,6 @@ async def get_events(
|
|||
if cached_keys & {key}:
|
||||
continue
|
||||
|
||||
if not (ts := event["date"]):
|
||||
continue
|
||||
|
||||
start_ts = int(str(ts)[:-3])
|
||||
|
||||
event_dt = Time.from_ts(start_ts)
|
||||
|
||||
if not start_dt <= event_dt <= end_dt:
|
||||
continue
|
||||
|
||||
sources: list[dict[str, str]] = event["sources"]
|
||||
|
||||
if not sources:
|
||||
|
|
@ -257,7 +257,7 @@ async def scrape(client: httpx.AsyncClient) -> None:
|
|||
|
||||
key = f"[{sport}] {event} (STRMD)"
|
||||
|
||||
tvg_id, pic = get_tvg_id(sport, event)
|
||||
tvg_id, pic = get_tvg_info(sport, event)
|
||||
|
||||
entry = {
|
||||
"url": url,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue