mirror of
https://github.com/doms9/iptv.git
synced 2026-01-21 03:59:03 +01:00
e
This commit is contained in:
parent
7aced386b2
commit
00000d9703
2 changed files with 4 additions and 11 deletions
|
|
@ -62,7 +62,7 @@ async def main() -> None:
|
||||||
asyncio.create_task(roxie.scrape()),
|
asyncio.create_task(roxie.scrape()),
|
||||||
asyncio.create_task(shark.scrape()),
|
asyncio.create_task(shark.scrape()),
|
||||||
asyncio.create_task(sport9.scrape()),
|
asyncio.create_task(sport9.scrape()),
|
||||||
asyncio.create_task(streambtw.scrape()),
|
# asyncio.create_task(streambtw.scrape()),
|
||||||
asyncio.create_task(streamcenter.scrape()),
|
asyncio.create_task(streamcenter.scrape()),
|
||||||
asyncio.create_task(streamfree.scrape()),
|
asyncio.create_task(streamfree.scrape()),
|
||||||
asyncio.create_task(streamhub.scrape()),
|
asyncio.create_task(streamhub.scrape()),
|
||||||
|
|
|
||||||
|
|
@ -25,29 +25,22 @@ async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
|
||||||
if not (api_data := API_FILE.load(per_entry=False)):
|
if not (api_data := API_FILE.load(per_entry=False)):
|
||||||
log.info("Refreshing API cache")
|
log.info("Refreshing API cache")
|
||||||
|
|
||||||
api_data = {"timestamp": now.timestamp()}
|
|
||||||
|
|
||||||
if r := await network.request(
|
if r := await network.request(
|
||||||
API_URL,
|
API_URL,
|
||||||
log=log,
|
log=log,
|
||||||
params={"user": "cdnlivetv", "plan": "free"},
|
params={"user": "cdnlivetv", "plan": "free"},
|
||||||
):
|
):
|
||||||
api_data: dict = r.json()
|
api_data = r.json().get("cdn-live-tv", {"timestamp": now.timestamp()})
|
||||||
|
|
||||||
api_data["timestamp"] = now.timestamp()
|
|
||||||
|
|
||||||
API_FILE.write(api_data)
|
API_FILE.write(api_data)
|
||||||
|
|
||||||
if not (data := api_data.get("cdn-live-tv")):
|
|
||||||
return events
|
|
||||||
|
|
||||||
start_dt = now.delta(minutes=-30)
|
start_dt = now.delta(minutes=-30)
|
||||||
end_dt = now.delta(minutes=30)
|
end_dt = now.delta(minutes=30)
|
||||||
|
|
||||||
sports = [key for key in data.keys() if not key.islower()]
|
sports = [key for key in api_data.keys() if not key.islower()]
|
||||||
|
|
||||||
for sport in sports:
|
for sport in sports:
|
||||||
event_info = data[sport]
|
event_info = api_data[sport]
|
||||||
|
|
||||||
for event in event_info:
|
for event in event_info:
|
||||||
t1, t2 = event["awayTeam"], event["homeTeam"]
|
t1, t2 = event["awayTeam"], event["homeTeam"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue