From 0281bb946d0f9a1a5374175f94542d55312353bc Mon Sep 17 00:00:00 2001 From: piair Date: Wed, 21 Jun 2023 21:24:30 +0200 Subject: [PATCH] =?UTF-8?q?u=C3=A9u=C3=A9u=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 ++--- V6.py | 61 ++++++++++++++++++++++++-------------------- build.sh | 2 +- user_data/.gitignore | 4 +++ 4 files changed, 41 insertions(+), 32 deletions(-) create mode 100644 user_data/.gitignore diff --git a/.gitignore b/.gitignore index 9aaf2af..0e6c94c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/old + geckodriver.log .vscode/ /Git @@ -7,8 +7,8 @@ screenshot.png login.csv data **/__pycache__ -/user_data +user_data/* install.sh nohup.out points.csv -/dev +file.png \ No newline at end of file diff --git a/V6.py b/V6.py index 0f8210b..e314bd5 100755 --- a/V6.py +++ b/V6.py @@ -25,14 +25,14 @@ def firefox_driver(mobile=False, headless=False): "CriOS/107.0.5060.64 Mobile/15E148 Safari/604.1" ) chrome_options = webdriver.ChromeOptions() - if mobile: - chrome_options.add_argument(f"--user-agent={PC_USER_AGENT}") - else : - chrome_options.add_argument(f"--user-agent={MOBILE_USER_AGENT}") + #if mobile: + # chrome_options.add_argument(f"--user-agent={PC_USER_AGENT}") + #else : + # chrome_options.add_argument(f"--user-agent={MOBILE_USER_AGENT}") + ## disabled as it may cause detection if g.proxy_enabled: PROXY = f"{g.proxy_address}:{g.proxy_port}" # IP:PORT or HOST:PORT chrome_options.add_argument(f'--proxy-server={PROXY}') - driver = uc.Chrome(options=chrome_options) return(driver) @@ -278,6 +278,10 @@ def all_cards(): log_error(f"Cart completion - log - 3 - after 10 sec", driver) try: try_play(driver.title) # go back to the main page + try : + close_tab(driver.window_handles[1], driver.window_handles[1]) + except: + pass except : driver.get("https://rewards.bing.com") except : @@ -834,28 +838,29 @@ else: if g.discord_enabled_error: webhookFailure.send(f"Updated to {g.update_version}", username="UPDATE", avatar_url="https://cdn-icons-png.flaticon.com/512/1688/1688988.png") for cred in g._cred: - g._mail = cred[0] - g._password = cred[1] - if cred[2] != '': - g._otp = TOTP(cred[2]) - custom_sleep(1) - printf("Début du driver.") - driver = firefox_driver() - printf("Driver demarré.") - driver.implicitly_wait(3) - try: - daily_routine() - driver.quit() - attente = uniform(1200, 3600) - printf(f"finis. attente de {round(attente/60)}min") - custom_sleep(attente) - except KeyboardInterrupt: - printf("Canceled. Closing driver and display.") - driver.quit() - display.stop() - except Exception as e: - log_error(f"Error not catched. Skipping this account. " + format_error(e), driver) - printf(f"Error not catched. Skipping this account. {e}") - driver.quit() + if cred != "": + g._mail = cred[0] + g._password = cred[1] + if cred[2] != '': + g._otp = TOTP(cred[2]) + custom_sleep(1) + printf("Début du driver.") + driver = firefox_driver() + printf("Driver demarré.") + driver.implicitly_wait(3) + try: + daily_routine() + driver.quit() + attente = uniform(1200, 3600) + printf(f"finis. attente de {round(attente/60)}min") + custom_sleep(attente) + except KeyboardInterrupt: + printf("Canceled. Closing driver and display.") + driver.quit() + display.stop() + except Exception as e: + log_error(f"Error not catched. Skipping this account. " + format_error(e), driver) + printf(f"Error not catched. Skipping this account. {e}") + driver.quit() display.stop() diff --git a/build.sh b/build.sh index ba3c734..d499417 100755 --- a/build.sh +++ b/build.sh @@ -3,4 +3,4 @@ echo "Enter the name of the instance" read name -sudo docker build -t msrewards . && sudo docker run -p 1234:1234 --shm-size=2gb --name $name msrewards +sudo docker build -t msrewards . && sudo docker run -p 1234:1234 -p 2345:2345 --shm-size=2gb --name $name msrewards diff --git a/user_data/.gitignore b/user_data/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/user_data/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore