mirror of
https://github.com/j93es/browser-use-oauth.git
synced 2026-06-04 06:21:52 +09:00
깃헙 모델 탑재 완료 : 사용시 0$ 소모
This commit is contained in:
parent
ce5135717c
commit
44cdab2b40
6 changed files with 147 additions and 89 deletions
27
lib/browser_config.py
Normal file
27
lib/browser_config.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
from browser_use.browser.context import BrowserContextConfig
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
def browser_config_kwargs(lang: str = "en_US") -> dict:
|
||||
browser_config_kwargs = {
|
||||
"browser_type": "chromium",
|
||||
"headless": False,
|
||||
"disable_security": True,
|
||||
"extra_browser_args": [
|
||||
"--disable-web-security",
|
||||
"--disable-features=IsolateOrigins,site-per-process",
|
||||
"--disable-popup-blocking",
|
||||
f"--lang={lang}",
|
||||
],
|
||||
}
|
||||
|
||||
browser_binary_path = os.getenv("BROWSER_BINARY_PATH")
|
||||
if browser_binary_path:
|
||||
browser_config_kwargs["browser_binary_path"] = browser_binary_path
|
||||
|
||||
proxy_host = os.getenv("PROXY_HOST")
|
||||
proxy_port = os.getenv("PROXY_PORT")
|
||||
if proxy_host and proxy_port:
|
||||
browser_config_kwargs["proxy"] = {"server": f"http://{proxy_host}:{proxy_port}"}
|
||||
|
||||
return browser_config_kwargs
|
||||
Loading…
Add table
Add a link
Reference in a new issue