This commit is contained in:
doms9 2025-09-20 23:26:18 -04:00
parent 5a61e2a8d5
commit 00000d9db0
11 changed files with 809 additions and 162 deletions

View file

@ -25,8 +25,8 @@ async def fetch_m3u8(client: httpx.AsyncClient) -> list[str]:
return r.text.splitlines()
async def main(client: httpx.AsyncClient) -> None:
if cached := load_cache(CACHE_FILE, exp=86400, nearest_hr=True):
async def scrape(client: httpx.AsyncClient) -> None:
if cached := load_cache(CACHE_FILE, exp=86_400, nearest_hr=True):
urls.update(cached)
log.info(f"Collected {len(urls)} event(s) from cache")
return
@ -52,8 +52,10 @@ async def main(client: httpx.AsyncClient) -> None:
if url.endswith("/hd"):
key = f"[{sport}] {tvg_name} (TVP)"
channel = url.split("/")[-2]
entry = {
"url": f"http://origin.thetvapp.to/hls/{url.split('/')[-2]}/mono.m3u8",
"url": f"http://origin.thetvapp.to/hls/{channel}/mono.m3u8",
"logo": league_info(sport)["logo"],
"id": league_info(sport)["id"],
"base": "https://tvpass.org",