This commit is contained in:
zjf 2025-05-28 11:35:35 +08:00
parent ec99ce0db2
commit 2c82e2be99
1 changed files with 4 additions and 1 deletions

View File

@ -163,6 +163,8 @@ async def get_promotion_list_text(page: Page, result: LiveStreamResult,
start_polling = time.time() start_polling = time.time()
last_status_check = start_polling last_status_check = start_polling
result.start_time = int(time.time() * 1000)
while time.time() - start_polling < max_duration: while time.time() - start_polling < max_duration:
# Check live status every 60 seconds # Check live status every 60 seconds
@ -450,7 +452,7 @@ with rpa_image.imports():
return result.dict() # Return as dict for JSON compatibility return result.dict() # Return as dict for JSON compatibility
async def goto_live(browser, data, result, webcast_id): async def goto_live(browser, data: LiveStreamProductWatchRequest, result: LiveStreamResult, webcast_id):
context = await browser.new_context() context = await browser.new_context()
await context.add_cookies(cookies) await context.add_cookies(cookies)
logger.info("Loaded cookies") logger.info("Loaded cookies")
@ -462,6 +464,7 @@ with rpa_image.imports():
result.title = await page.title() result.title = await page.title()
logger.info(f"Retrieved title: {result.title}") logger.info(f"Retrieved title: {result.title}")
live_status = await get_live_status_by_web_page(page, webcast_id) live_status = await get_live_status_by_web_page(page, webcast_id)
if live_status == LIVE_END: if live_status == LIVE_END:
result.msg = LIVE_END result.msg = LIVE_END
else: else: