mirror of
https://github.com/doms9/iptv.git
synced 2026-06-14 12:36:27 +02:00
e
- misc edits.
This commit is contained in:
parent
b0c3f0edd0
commit
00000d9540
1 changed files with 20 additions and 6 deletions
|
|
@ -99,9 +99,9 @@ async def get_events() -> list[dict[str, str]]:
|
||||||
return events
|
return events
|
||||||
|
|
||||||
for stream_group in api_data:
|
for stream_group in api_data:
|
||||||
date = stream_group.get("time")
|
date: str = stream_group.get("time")
|
||||||
|
|
||||||
sport = stream_group.get("league")
|
sport: str = stream_group.get("league")
|
||||||
|
|
||||||
t1, t2 = stream_group.get("away"), stream_group.get("home")
|
t1, t2 = stream_group.get("away"), stream_group.get("home")
|
||||||
|
|
||||||
|
|
@ -113,13 +113,27 @@ async def get_events() -> list[dict[str, str]]:
|
||||||
if event_dt.date() != now.date():
|
if event_dt.date() != now.date():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not (streams := stream_group.get("streams")) or not (
|
if not (t1 and t2):
|
||||||
url := streams[0].get("url")
|
continue
|
||||||
|
|
||||||
|
if not (streams := stream_group.get("streams")):
|
||||||
|
continue
|
||||||
|
|
||||||
|
elif not (
|
||||||
|
valid_streams := sorted(
|
||||||
|
[
|
||||||
|
*filter(
|
||||||
|
lambda x: (lth := len(x.get("lang"))) == 0 or lth > 2,
|
||||||
|
streams,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
key=lambda x: len(x.get("lang")),
|
||||||
|
reverse=True,
|
||||||
|
)
|
||||||
):
|
):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not (t1 and t2):
|
url = valid_streams[0]["url"]
|
||||||
continue
|
|
||||||
|
|
||||||
event = get_event(t1, t2)
|
event = get_event(t1, t2)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue