Compare commits

...

2 commits

Author SHA1 Message Date
GitHub Actions Bot
2cccac4aa7 update M3U8 2025-12-05 21:31:04 -05:00
doms9
00000d90ea e 2025-12-05 21:26:10 -05:00
3 changed files with 1283 additions and 982 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -134,8 +134,9 @@ async def get_events(
async def scrape(client: httpx.AsyncClient) -> None:
cached_urls = CACHE_FILE.load()
cached_count = len(cached_urls)
urls.update(cached_urls)
valid_urls = {k: v for k, v in cached_urls.items() if v["url"]}
valid_count = cached_count = len(valid_urls)
urls.update(valid_urls)
log.info(f"Loaded {cached_count} event(s) from cache")
@ -183,13 +184,13 @@ async def scrape(client: httpx.AsyncClient) -> None:
"link": ev["link"],
}
cached_urls[key] = entry
urls[key] = cached_urls[key] = entry
if url:
valid_count += 1
urls[key] = entry
await browser.close()
if new_count := len(cached_urls) - cached_count:
if new_count := valid_count - cached_count:
log.info(f"Collected and cached {new_count} new event(s)")
else:
log.info("No new events found")