e
This commit is contained in:
parent
5a61e2a8d5
commit
00000d9db0
11 changed files with 809 additions and 162 deletions
|
|
@ -132,6 +132,7 @@ async def process_event(url: str, url_num: int) -> str | None:
|
|||
return
|
||||
else:
|
||||
log.warning(f"URL {url_num}) Browser Links tab not found")
|
||||
return
|
||||
|
||||
link_img = await page.query_selector(
|
||||
"tr:nth-child(2) > td:nth-child(1) td:nth-child(6) img"
|
||||
|
|
@ -165,7 +166,7 @@ async def process_event(url: str, url_num: int) -> str | None:
|
|||
wait_task = asyncio.create_task(got_one.wait())
|
||||
|
||||
try:
|
||||
await asyncio.wait_for(wait_task, timeout=1.5e1)
|
||||
await asyncio.wait_for(wait_task, timeout=15)
|
||||
except asyncio.TimeoutError:
|
||||
log.warning(f"URL {url_num}) Timed out waiting for M3U8.")
|
||||
return
|
||||
|
|
@ -272,8 +273,8 @@ async def get_events(
|
|||
return events
|
||||
|
||||
|
||||
async def main(client: httpx.AsyncClient) -> None:
|
||||
cached_urls = load_cache(CACHE_FILE, exp=10800)
|
||||
async def scrape(client: httpx.AsyncClient) -> None:
|
||||
cached_urls = load_cache(CACHE_FILE, exp=10_800)
|
||||
cached_count = len(cached_urls)
|
||||
urls.update(cached_urls)
|
||||
|
||||
|
|
@ -307,10 +308,15 @@ async def main(client: httpx.AsyncClient) -> None:
|
|||
|
||||
key = f"[{sport}: {event}] {title} (LTVSX)"
|
||||
|
||||
tvg_id, logo = league_info(sport)
|
||||
|
||||
if not tvg_id:
|
||||
tvg_id, logo = league_info(event)
|
||||
|
||||
entry = {
|
||||
"url": url,
|
||||
"logo": league_info(sport)["logo"],
|
||||
"id": league_info(sport)["id"],
|
||||
"logo": logo,
|
||||
"id": tvg_id or "Live.Event.us",
|
||||
"base": "https://livetv.sx/enx/",
|
||||
"timestamp": now.timestamp(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue