- misc edits.
This commit is contained in:
doms9 2026-04-22 21:26:41 -04:00
parent 22645d6b75
commit 00000d9e1a
4 changed files with 4 additions and 21 deletions

View file

@ -104,9 +104,7 @@ async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
for game in data.get("games", {}): for game in data.get("games", {}):
game_id = game["id"] game_id = game["id"]
game_time = game["datetime"] event_dt = Time.fromisoformat(game["datetime"]).to_tz("EST")
event_dt = Time.from_str(game_time, timezone="UTC")
if not start_dt <= event_dt <= end_dt: if not start_dt <= event_dt <= end_dt:
continue continue

View file

@ -54,12 +54,9 @@ async def process_event(
return return
try: try:
if btn := page.locator("button.streambutton").first: btn = page.locator("button.streambutton").first
await btn.click(
force=True, await btn.dblclick(force=True, timeout=3_000)
click_count=2,
timeout=3_000,
)
await page.wait_for_function( await page.wait_for_function(
"() => typeof clapprPlayer !== 'undefined'", "() => typeof clapprPlayer !== 'undefined'",

View file

@ -81,12 +81,8 @@ class Time(datetime):
"%Y-%m-%d %I:%M %p", "%Y-%m-%d %I:%M %p",
"%Y-%m-%d %H:%M %p", "%Y-%m-%d %H:%M %p",
"%Y-%m-%dT%H:%M:%S", "%Y-%m-%dT%H:%M:%S",
"%Y-%m-%dT%H:%M:%SZ",
"%Y-%m-%dT%H:%M:%S%z",
"%Y-%m-%dT%H:%M:%S.%fZ",
"%Y/%m/%d %H:%M", "%Y/%m/%d %H:%M",
"%Y/%m/%d %H:%M:%S", "%Y/%m/%d %H:%M:%S",
"%Y/%m/%dT%H:%M:%S.%fZ",
"%m/%d/%Y %H:%M", "%m/%d/%Y %H:%M",
"%m/%d/%Y %I:%M %p", "%m/%d/%Y %I:%M %p",
"%m/%d/%Y %H:%M:%S", "%m/%d/%Y %H:%M:%S",

View file

@ -270,7 +270,6 @@ class Network:
log.warning( log.warning(
f"URL {url_num}) Status Code: {resp.status if resp else 'None'}" f"URL {url_num}) Status Code: {resp.status if resp else 'None'}"
) )
return return
wait_task = asyncio.create_task(got_one.wait()) wait_task = asyncio.create_task(got_one.wait())
@ -279,7 +278,6 @@ class Network:
await asyncio.wait_for(wait_task, timeout=timeout) await asyncio.wait_for(wait_task, timeout=timeout)
except asyncio.TimeoutError: except asyncio.TimeoutError:
log.warning(f"URL {url_num}) Timed out waiting for M3U8.") log.warning(f"URL {url_num}) Timed out waiting for M3U8.")
return return
finally: finally:
@ -293,16 +291,10 @@ class Network:
if captured: if captured:
log.info(f"URL {url_num}) Captured M3U8") log.info(f"URL {url_num}) Captured M3U8")
return captured[0] return captured[0]
log.warning(f"URL {url_num}) No M3U8 captured after waiting.")
return
except Exception as e: except Exception as e:
log.warning(f"URL {url_num}) {e}") log.warning(f"URL {url_num}) {e}")
return return
finally: finally: