This commit is contained in:
doms9 2025-12-18 04:14:54 -05:00
parent 8b2d8cc1fc
commit 00000d939c
20 changed files with 119 additions and 12 deletions

View file

@ -26,7 +26,9 @@ async def get_events() -> dict[str, dict[str, str | float]]:
for i, line in enumerate(data, start=1):
if line.startswith("#EXTINF"):
tvg_id_match = re.search(r'tvg-id="([^"]*)"', line)
tvg_name_match = re.search(r'tvg-name="([^"]*)"', line)
group_title_match = re.search(r'group-title="([^"]*)"', line)
tvg = tvg_id_match[1] if tvg_id_match else None
@ -57,7 +59,9 @@ async def get_events() -> dict[str, dict[str, str | float]]:
async def scrape() -> None:
if cached := CACHE_FILE.load():
urls.update(cached)
log.info(f"Loaded {len(urls)} event(s) from cache")
return
log.info(f'Scraping from "{BASE_URL}"')