mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-06-06 11:05:26 +00:00
feat : remove browser message
This commit is contained in:
parent
557f7aa333
commit
cc951d4745
Binary file not shown.
Before Width: | Height: | Size: 147 KiB |
@ -49,19 +49,22 @@ def create_driver(headless=False):
|
|||||||
|
|
||||||
if headless:
|
if headless:
|
||||||
chrome_options.add_argument("--headless")
|
chrome_options.add_argument("--headless")
|
||||||
chrome_options.add_argument("--disable-gpu")
|
chrome_options.add_argument("--disable-gpu")
|
||||||
|
chrome_options.add_argument("--disable-webgl")
|
||||||
chrome_options.add_argument("--no-sandbox")
|
chrome_options.add_argument("--no-sandbox")
|
||||||
chrome_options.add_argument("--disable-dev-shm-usage")
|
chrome_options.add_argument("--disable-dev-shm-usage")
|
||||||
chrome_options.add_argument("--autoplay-policy=user-gesture-required")
|
chrome_options.add_argument("--autoplay-policy=user-gesture-required")
|
||||||
chrome_options.add_argument("--mute-audio")
|
chrome_options.add_argument("--mute-audio")
|
||||||
chrome_options.add_argument("--disable-webgl")
|
|
||||||
chrome_options.add_argument("--disable-notifications")
|
chrome_options.add_argument("--disable-notifications")
|
||||||
|
chrome_options.add_argument('--window-size=1080,560')
|
||||||
security_prefs = {
|
security_prefs = {
|
||||||
"profile.default_content_setting_values.media_stream": 2,
|
"profile.default_content_setting_values.media_stream": 2,
|
||||||
"profile.default_content_setting_values.geolocation": 2,
|
"profile.default_content_setting_values.geolocation": 2,
|
||||||
"safebrowsing.enabled": True,
|
"safebrowsing.enabled": True,
|
||||||
}
|
}
|
||||||
chrome_options.add_experimental_option("prefs", security_prefs)
|
chrome_options.add_experimental_option("prefs", security_prefs)
|
||||||
|
chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])
|
||||||
|
chrome_options.add_experimental_option('useAutomationExtension', False)
|
||||||
|
|
||||||
chromedriver_path = shutil.which("chromedriver")
|
chromedriver_path = shutil.which("chromedriver")
|
||||||
if not chromedriver_path:
|
if not chromedriver_path:
|
||||||
@ -74,7 +77,7 @@ def create_driver(headless=False):
|
|||||||
return webdriver.Chrome(service=service, options=chrome_options)
|
return webdriver.Chrome(service=service, options=chrome_options)
|
||||||
|
|
||||||
class Browser:
|
class Browser:
|
||||||
def __init__(self, driver, headless=False, anticaptcha_install=True):
|
def __init__(self, driver, anticaptcha_install=True):
|
||||||
"""Initialize the browser with optional headless mode."""
|
"""Initialize the browser with optional headless mode."""
|
||||||
self.js_scripts_folder = "./sources/web_scripts/" if not __name__ == "__main__" else "./web_scripts/"
|
self.js_scripts_folder = "./sources/web_scripts/" if not __name__ == "__main__" else "./web_scripts/"
|
||||||
self.anticaptcha = "https://chrome.google.com/webstore/detail/nopecha-captcha-solver/dknlfmjaanfblgfdfebhijalfmhmjjjo/related"
|
self.anticaptcha = "https://chrome.google.com/webstore/detail/nopecha-captcha-solver/dknlfmjaanfblgfdfebhijalfmhmjjjo/related"
|
||||||
|
@ -55,7 +55,7 @@ def pretty_print(text, color="info"):
|
|||||||
color = "info"
|
color = "info"
|
||||||
print(colored(text, color_map[color]))
|
print(colored(text, color_map[color]))
|
||||||
|
|
||||||
def animate_thinking(text, color="status", duration=2):
|
def animate_thinking(text, color="status", duration=120):
|
||||||
"""
|
"""
|
||||||
Animate a thinking spinner while a task is being executed.
|
Animate a thinking spinner while a task is being executed.
|
||||||
It use a daemon thread to run the animation. This will not block the main thread.
|
It use a daemon thread to run the animation. This will not block the main thread.
|
||||||
@ -77,9 +77,10 @@ def animate_thinking(text, color="status", duration=2):
|
|||||||
}
|
}
|
||||||
fore_color, term_color = color_map.get(color, color_map["default"])
|
fore_color, term_color = color_map.get(color, color_map["default"])
|
||||||
spinner = itertools.cycle([
|
spinner = itertools.cycle([
|
||||||
'█▒▒▒▒▒', '██▒▒▒▒', '███▒▒▒', '████▒▒', '█████▒', '██████',
|
'▉▁▁▁▁▁', '▉▉▂▁▁▁', '▉▉▉▃▁▁', '▉▉▉▉▅▁', '▉▉▉▉▉▇', '▉▉▉▉▉▉',
|
||||||
'█████▒', '████▒▒', '███▒▒▒', '██▒▒▒▒', '█▒▒▒▒▒', '▒█▒▒▒█',
|
'▉▉▉▉▇▅', '▉▉▉▆▃▁', '▉▉▅▃▁▁', '▉▇▃▁▁▁', '▇▃▁▁▁▁', '▃▁▁▁▁▁',
|
||||||
'▒▒█▒█▒', '▒▒▒██▒', '▒█▒█▒▒', '█▒▒▒▒▒'
|
'▁▃▅▃▁▁', '▁▅▉▅▁▁', '▃▉▉▉▃▁', '▅▉▁▉▅▃', '▇▃▁▃▇▅', '▉▁▁▁▉▇',
|
||||||
|
'▉▅▃▁▃▅', '▇▉▅▃▅▇', '▅▉▇▅▇▉', '▃▇▉▇▉▅', '▁▅▇▉▇▃', '▁▃▅▇▅▁'
|
||||||
])
|
])
|
||||||
end_time = time.time() + duration
|
end_time = time.time() + duration
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user