Compare commits
No commits in common. "f9a21f5b9803bcdca80c398a07dd90bade44d0c2" and "c7e110787babfe420051e8b1622adf52e1595851" have entirely different histories.
f9a21f5b98
...
c7e110787b
24
V6.py
24
V6.py
|
@ -220,6 +220,22 @@ def all_cards():
|
||||||
custom_sleep(1.5)
|
custom_sleep(1.5)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def check_streak_protection() -> bool:
|
||||||
|
"""
|
||||||
|
Ne perdez plus jamais votre série !
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
streak_protection_close = driver.find_element(By.ID, "streak-protection-popup-close-cross")
|
||||||
|
streak_protection_activate = driver.find_elements(By.CLASS_NAME, "earningPagePopUpPopUpSelectButton")
|
||||||
|
streak_protection_activate[0].click()
|
||||||
|
info("Popup 'Streak Protection' reçue")
|
||||||
|
custom_sleep(1.5)
|
||||||
|
|
||||||
|
return True
|
||||||
|
except (exceptions.NoSuchElementException, exceptions.ElementNotInteractableException, IndexError):
|
||||||
|
# les éléments sont présents dans le DOM même quand la popup n'est pas visible apparemment
|
||||||
|
return False
|
||||||
|
|
||||||
driver.get("https://rewards.bing.com")
|
driver.get("https://rewards.bing.com")
|
||||||
wait_until_visible(By.CLASS_NAME, "c-card-content", 10, driver)
|
wait_until_visible(By.CLASS_NAME, "c-card-content", 10, driver)
|
||||||
|
|
||||||
|
@ -274,6 +290,7 @@ def all_cards():
|
||||||
|
|
||||||
custom_sleep(1.5)
|
custom_sleep(1.5)
|
||||||
check_welcome_tour()
|
check_welcome_tour()
|
||||||
|
check_streak_protection()
|
||||||
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
|
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
|
||||||
custom_sleep(1.5)
|
custom_sleep(1.5)
|
||||||
card_list[i].click()
|
card_list[i].click()
|
||||||
|
@ -291,6 +308,7 @@ def all_cards():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
check_welcome_tour()
|
check_welcome_tour()
|
||||||
|
check_streak_protection()
|
||||||
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
|
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
|
||||||
card_list[i].click()
|
card_list[i].click()
|
||||||
|
|
||||||
|
@ -402,11 +420,6 @@ def explore_on_bing(activity: str, config: Config):
|
||||||
]
|
]
|
||||||
chosen = random.sample(currencies, k=2)
|
chosen = random.sample(currencies, k=2)
|
||||||
search_bing(f"convertir {random.randint(2, 120)} {chosen[0]} en {chosen[1]}")
|
search_bing(f"convertir {random.randint(2, 120)} {chosen[0]} en {chosen[1]}")
|
||||||
elif "weather" in activity:
|
|
||||||
search_bing(f"météo {['Paris', 'Nice', 'Marseille', 'Bordeaux', 'Lyon'][randint(0, 4)]}")
|
|
||||||
elif "packagetracking" in activity:
|
|
||||||
driver.get("https://www.bing.com/?setmkt=en-US&setlang=en-US")
|
|
||||||
search_bing(f"{['fedex', 'UPS', '']} package tracking")
|
|
||||||
else:
|
else:
|
||||||
log_error(f"Explore on bing: {activity} not found.")
|
log_error(f"Explore on bing: {activity} not found.")
|
||||||
|
|
||||||
|
@ -884,6 +897,7 @@ def default_start():
|
||||||
try:
|
try:
|
||||||
config.WebDriver.set_pc_driver(create_driver())
|
config.WebDriver.set_pc_driver(create_driver())
|
||||||
except:
|
except:
|
||||||
|
info("Could not configure driver. Trying to update it.")
|
||||||
subprocess.Popen(["python3", "/app/MsRewards-Reborn/modules/Tools/update_chrome.py"])
|
subprocess.Popen(["python3", "/app/MsRewards-Reborn/modules/Tools/update_chrome.py"])
|
||||||
config.WebDriver.set_pc_driver(create_driver())
|
config.WebDriver.set_pc_driver(create_driver())
|
||||||
config.WebDriver.switch_to_driver("PC")
|
config.WebDriver.switch_to_driver("PC")
|
||||||
|
|
Loading…
Reference in New Issue