Update app.py
Browse files
app.py
CHANGED
|
@@ -51,8 +51,6 @@ async def make_screenshot(page: Page):
|
|
| 51 |
async def refresh_token():
|
| 52 |
max_timeout = BROWSER_TIMEOUT_SECONDS * 1000
|
| 53 |
json_data = {'accessToken': None}
|
| 54 |
-
user_data_dir = Path(__file__).parent / 'user_data'
|
| 55 |
-
user_data_dir.mkdir(exist_ok=True, parents=True)
|
| 56 |
async with async_playwright() as playwright:
|
| 57 |
logger.info('запуск браузера')
|
| 58 |
browser = await playwright.chromium.launch(headless=True, args=['--disable-blink-features=AutomationControlled'])
|
|
@@ -62,7 +60,6 @@ async def refresh_token():
|
|
| 62 |
locale='en-US',
|
| 63 |
user_agent=UA,
|
| 64 |
no_viewport=True,
|
| 65 |
-
user_data_dir=user_data_dir.resolve().as_posix()
|
| 66 |
)
|
| 67 |
context.set_default_timeout(max_timeout)
|
| 68 |
context.set_default_navigation_timeout(max_timeout)
|
|
|
|
| 51 |
async def refresh_token():
|
| 52 |
max_timeout = BROWSER_TIMEOUT_SECONDS * 1000
|
| 53 |
json_data = {'accessToken': None}
|
|
|
|
|
|
|
| 54 |
async with async_playwright() as playwright:
|
| 55 |
logger.info('запуск браузера')
|
| 56 |
browser = await playwright.chromium.launch(headless=True, args=['--disable-blink-features=AutomationControlled'])
|
|
|
|
| 60 |
locale='en-US',
|
| 61 |
user_agent=UA,
|
| 62 |
no_viewport=True,
|
|
|
|
| 63 |
)
|
| 64 |
context.set_default_timeout(max_timeout)
|
| 65 |
context.set_default_navigation_timeout(max_timeout)
|