zz2
This commit is contained in:
1 parent
8c68bd8962
commit
54723d7f2d
2 files changed
+16
-14
No files matched your search
Binary file not shown.
@@ -80,24 +80,26 @@ async def run_browser_task(task_id: str, task: str, max_steps: int, model: str):
|
||||
import subprocess
|
||||
import glob
|
||||
|
||||
# Ищем chromium в типичных местах (включая ms-playwright)
|
||||
chromium_search_paths = [
|
||||
"/ms-playwright/chromium-*/chrome-linux/chrome",
|
||||
"/root/.cache/ms-playwright/chromium-*/chrome-linux/chrome",
|
||||
"/usr/bin/chromium",
|
||||
"/usr/bin/chromium-browser",
|
||||
"/usr/bin/google-chrome",
|
||||
]
|
||||
# Точный путь из контейнера
|
||||
CHROME_PATH = "/root/.cache/ms-playwright/chromium-1208/chrome-linux64/chrome"
|
||||
|
||||
# Ищем chrome
|
||||
chrome_exe = None
|
||||
for pattern in chromium_search_paths:
|
||||
matches = glob.glob(pattern)
|
||||
if matches:
|
||||
chrome_exe = matches[0] # Берем первый найденный
|
||||
break
|
||||
if os.path.exists(CHROME_PATH):
|
||||
chrome_exe = CHROME_PATH
|
||||
else:
|
||||
# Fallback - ищем в кэше
|
||||
for pattern in [
|
||||
"/root/.cache/ms-playwright/chromium-*/chrome-linux64/chrome",
|
||||
"/ms-playwright/*/chrome-linux/chrome",
|
||||
]:
|
||||
matches = glob.glob(pattern)
|
||||
if matches:
|
||||
chrome_exe = matches[0]
|
||||
break
|
||||
|
||||
if not chrome_exe:
|
||||
raise RuntimeError(f"Chrome/Chromium not found. Searched: {chromium_search_paths}")
|
||||
raise RuntimeError(f"Chrome not found. Path: {CHROME_PATH}")
|
||||
|
||||
# Создаем директорию для профиля
|
||||
user_data_dir = "/app/browser-data"
|
||||
|
||||
Reference in new issue
Block a user