mirror of
https://github.com/lalifeier/IPTV.git
synced 2025-12-18 15:55:54 +08:00
init
This commit is contained in:
17
iptv/playwright.py
Normal file
17
iptv/playwright.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
Reference in New Issue
Block a user