diff --git a/media/exemples/brooo.png b/media/exemples/brooo.png deleted file mode 100644 index 74e691c..0000000 Binary files a/media/exemples/brooo.png and /dev/null differ diff --git a/sources/browser.py b/sources/browser.py index c870be9..b82ce4e 100644 --- a/sources/browser.py +++ b/sources/browser.py @@ -49,19 +49,22 @@ def create_driver(headless=False): if 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("--disable-dev-shm-usage") chrome_options.add_argument("--autoplay-policy=user-gesture-required") chrome_options.add_argument("--mute-audio") - chrome_options.add_argument("--disable-webgl") chrome_options.add_argument("--disable-notifications") + chrome_options.add_argument('--window-size=1080,560') security_prefs = { "profile.default_content_setting_values.media_stream": 2, "profile.default_content_setting_values.geolocation": 2, "safebrowsing.enabled": True, } 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") if not chromedriver_path: @@ -74,7 +77,7 @@ def create_driver(headless=False): return webdriver.Chrome(service=service, options=chrome_options) 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.""" 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" diff --git a/sources/utility.py b/sources/utility.py index 480253a..86126f1 100644 --- a/sources/utility.py +++ b/sources/utility.py @@ -55,7 +55,7 @@ def pretty_print(text, color="info"): color = "info" 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. 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"]) spinner = itertools.cycle([ - '█▒▒▒▒▒', '██▒▒▒▒', '███▒▒▒', '████▒▒', '█████▒', '██████', - '█████▒', '████▒▒', '███▒▒▒', '██▒▒▒▒', '█▒▒▒▒▒', '▒█▒▒▒█', - '▒▒█▒█▒', '▒▒▒██▒', '▒█▒█▒▒', '█▒▒▒▒▒' + '▉▁▁▁▁▁', '▉▉▂▁▁▁', '▉▉▉▃▁▁', '▉▉▉▉▅▁', '▉▉▉▉▉▇', '▉▉▉▉▉▉', + '▉▉▉▉▇▅', '▉▉▉▆▃▁', '▉▉▅▃▁▁', '▉▇▃▁▁▁', '▇▃▁▁▁▁', '▃▁▁▁▁▁', + '▁▃▅▃▁▁', '▁▅▉▅▁▁', '▃▉▉▉▃▁', '▅▉▁▉▅▃', '▇▃▁▃▇▅', '▉▁▁▁▉▇', + '▉▅▃▁▃▅', '▇▉▅▃▅▇', '▅▉▇▅▇▉', '▃▇▉▇▉▅', '▁▅▇▉▇▃', '▁▃▅▇▅▁' ]) end_time = time.time() + duration