mirror of
https://github.com/lalifeier/IPTV.git
synced 2025-12-16 23:10:57 +08:00
18 lines
428 B
Python
18 lines
428 B
Python
import logging
|
|
|
|
from playwright.async_api import Playwright, async_playwright
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
playwright: Playwright = None
|
|
|
|
async def get_playwright():
|
|
global playwright
|
|
if playwright is None:
|
|
try:
|
|
playwright = await async_playwright().start()
|
|
except Exception as e:
|
|
logging.error(f"Error starting Playwright: {e}")
|
|
raise
|
|
return playwright
|