mirror of
https://github.com/doms9/iptv.git
synced 2026-01-21 03:59:03 +01:00
e
fix window for embedhd.py fix window for streamcenter.py use preset logos for streamfree.py
This commit is contained in:
parent
e544d6fe32
commit
00000d9976
3 changed files with 7 additions and 11 deletions
|
|
@ -37,6 +37,8 @@ async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
|
||||||
API_CACHE.write(api_data)
|
API_CACHE.write(api_data)
|
||||||
|
|
||||||
events = []
|
events = []
|
||||||
|
start_dt = now.delta(minutes=-30)
|
||||||
|
end_dt = now.delta(hours=3)
|
||||||
|
|
||||||
for info in api_data.get("days", []):
|
for info in api_data.get("days", []):
|
||||||
for event in info["items"]:
|
for event in info["items"]:
|
||||||
|
|
@ -45,7 +47,7 @@ async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
|
||||||
|
|
||||||
event_dt = Time.from_str(event["when_et"], timezone="ET")
|
event_dt = Time.from_str(event["when_et"], timezone="ET")
|
||||||
|
|
||||||
if now.date() != event_dt.date():
|
if not start_dt <= event_dt <= end_dt:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
sport = fix_league(event_league)
|
sport = fix_league(event_league)
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,8 @@ async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
|
||||||
|
|
||||||
events = []
|
events = []
|
||||||
|
|
||||||
start_dt = now.delta(minutes=-30)
|
start_dt = now.delta(hours=-1)
|
||||||
end_dt = now.delta(minutes=10)
|
end_dt = now.delta(minutes=5)
|
||||||
|
|
||||||
for stream_group in api_data:
|
for stream_group in api_data:
|
||||||
category_id: int = stream_group.get("categoryId")
|
category_id: int = stream_group.get("categoryId")
|
||||||
|
|
|
||||||
|
|
@ -44,13 +44,7 @@ async def get_events() -> dict[str, dict[str, str | float]]:
|
||||||
|
|
||||||
key = f"[{sport}] {name} ({TAG})"
|
key = f"[{sport}] {name} ({TAG})"
|
||||||
|
|
||||||
logo = (
|
tvg_id, logo = leagues.get_tvg_info(sport, name)
|
||||||
urljoin(BASE_URL, thumbnail)
|
|
||||||
if (thumbnail := stream.get("thumbnail_url"))
|
|
||||||
else None
|
|
||||||
)
|
|
||||||
|
|
||||||
tvg_id, pic = leagues.get_tvg_info(sport, name)
|
|
||||||
|
|
||||||
events[key] = {
|
events[key] = {
|
||||||
"url": network.build_proxy_url(
|
"url": network.build_proxy_url(
|
||||||
|
|
@ -58,7 +52,7 @@ async def get_events() -> dict[str, dict[str, str | float]]:
|
||||||
path=f"{stream_key}/index.m3u8",
|
path=f"{stream_key}/index.m3u8",
|
||||||
query={"stream_name": name},
|
query={"stream_name": name},
|
||||||
),
|
),
|
||||||
"logo": logo or pic,
|
"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",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue