mirror of
https://github.com/j93es/browser-use-oauth.git
synced 2026-06-04 05:21:52 +09:00
Merge branch 'feat/storage-state' of https://github.com/j93es/browser-use-oauth into feat/storage-state
This commit is contained in:
commit
b49fe8b49e
1 changed files with 3 additions and 0 deletions
3
main.py
3
main.py
|
|
@ -19,6 +19,7 @@ from lib.utils import env_cheker
|
||||||
from lib.utils.backend_client import notify_backend
|
from lib.utils.backend_client import notify_backend
|
||||||
from lib.utils.browser_use import model
|
from lib.utils.browser_use import model
|
||||||
from lib.utils.browser_use.clean_resources import clean_resources
|
from lib.utils.browser_use.clean_resources import clean_resources
|
||||||
|
from lib.utils.browser_use.func import setup_storage_state
|
||||||
from lib.utils.config import BACKEND_URL, GOOGLE_MODEL, GOOGLE_PLANNER_MODEL
|
from lib.utils.config import BACKEND_URL, GOOGLE_MODEL, GOOGLE_PLANNER_MODEL
|
||||||
from lib.utils.is_html import is_html_url
|
from lib.utils.is_html import is_html_url
|
||||||
from lib.utils.read_txt import read_lines_between
|
from lib.utils.read_txt import read_lines_between
|
||||||
|
|
@ -83,6 +84,7 @@ signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
|
||||||
# ── URL별로 Browser를 새로 띄우는 함수 ──
|
# ── URL별로 Browser를 새로 띄우는 함수 ──
|
||||||
async def scan_one_url(url: str, skip_html_check: bool = False):
|
async def scan_one_url(url: str, skip_html_check: bool = False):
|
||||||
|
setup_storage_state()
|
||||||
target_url = url if url.startswith("http") else f"https://{url}"
|
target_url = url if url.startswith("http") else f"https://{url}"
|
||||||
print(f"🚀 Starting scan for: {target_url}")
|
print(f"🚀 Starting scan for: {target_url}")
|
||||||
|
|
||||||
|
|
@ -128,6 +130,7 @@ async def scan_one_url(url: str, skip_html_check: bool = False):
|
||||||
)
|
)
|
||||||
response = await agent.run()
|
response = await agent.run()
|
||||||
final_result = response.final_result()
|
final_result = response.final_result()
|
||||||
|
|
||||||
if final_result is None:
|
if final_result is None:
|
||||||
raise ValueError("final_result()가 None을 반환했습니다.")
|
raise ValueError("final_result()가 None을 반환했습니다.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue