e
This commit is contained in:
parent
00000d9199
commit
00000d92ff
1 changed files with 23 additions and 23 deletions
|
|
@ -225,7 +225,7 @@ 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)
|
||||
urls.update({k: v for k, v in cached_urls.items() if v["url"]})
|
||||
|
||||
log.info(f"Loaded {cached_count} event(s) from cache")
|
||||
|
||||
|
|
@ -244,8 +244,6 @@ async def scrape(client: httpx.AsyncClient) -> None:
|
|||
|
||||
log.info(f"Processing {len(events)} new URL(s)")
|
||||
|
||||
# breakpoint()
|
||||
|
||||
async with async_playwright() as p:
|
||||
browser, context = await network.browser(p)
|
||||
|
||||
|
|
@ -260,7 +258,6 @@ async def scrape(client: httpx.AsyncClient) -> None:
|
|||
log=log,
|
||||
)
|
||||
|
||||
if url:
|
||||
sport, event, logo, ts = (
|
||||
ev["sport"],
|
||||
ev["event"],
|
||||
|
|
@ -280,7 +277,10 @@ async def scrape(client: httpx.AsyncClient) -> None:
|
|||
"id": tvg_id or "Live.Event.us",
|
||||
}
|
||||
|
||||
urls[key] = cached_urls[key] = entry
|
||||
cached_urls[key] = entry
|
||||
|
||||
if url:
|
||||
urls[key] = entry
|
||||
|
||||
await browser.close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue