mirror of
https://gitea.augustin64.fr/piair/MsRewards-Reborn.git
synced 2025-07-01 12:23:57 +02:00
Compare commits
10 Commits
3c74aa025e
...
fix4
Author | SHA1 | Date | |
---|---|---|---|
a197d44768 | |||
c7e110787b | |||
1db1de9606 | |||
10d75f9d78 | |||
87fb791436 | |||
6995bde8a6 | |||
92069a013e | |||
906d3e7822 | |||
778adc67d2 | |||
402b8cd3ef |
56
V6.py
56
V6.py
@ -220,6 +220,22 @@ def all_cards():
|
||||
custom_sleep(1.5)
|
||||
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")
|
||||
wait_until_visible(By.CLASS_NAME, "c-card-content", 10, driver)
|
||||
|
||||
@ -274,6 +290,7 @@ def all_cards():
|
||||
|
||||
custom_sleep(1.5)
|
||||
check_welcome_tour()
|
||||
check_streak_protection()
|
||||
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
|
||||
custom_sleep(1.5)
|
||||
card_list[i].click()
|
||||
@ -291,6 +308,7 @@ def all_cards():
|
||||
continue
|
||||
|
||||
check_welcome_tour()
|
||||
check_streak_protection()
|
||||
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
|
||||
card_list[i].click()
|
||||
|
||||
@ -370,6 +388,43 @@ def explore_on_bing(activity: str, config: Config):
|
||||
search_bing(f"traduction {config.wordlist.get_word()} en anglais")
|
||||
elif "map" in activity:
|
||||
search_bing(f"{['Paris', 'Nice', 'Marseille', 'Bordeaux', 'Lyon'][randint(0, 4)]} carte")
|
||||
elif "restaurant" in activity:
|
||||
search_bing(random.choice([
|
||||
"restaurant à proximité",
|
||||
"restaurant pas loin",
|
||||
"manger dans le coin"
|
||||
]))
|
||||
elif "recipe" in activity:
|
||||
search_bing("recette de " + random.choice([
|
||||
"cake aux olives",
|
||||
"tarte tatin",
|
||||
"Kouign Amann",
|
||||
"poulet au Curry",
|
||||
"lasagnes aux épinards et ricotta",
|
||||
"Boeuf Bourguignon",
|
||||
"dessert",
|
||||
"gateau au chocolat",
|
||||
"crêpe sucrée"
|
||||
])) # Merci llama pour les idées
|
||||
elif "currency" in activity:
|
||||
currencies = [
|
||||
"euros",
|
||||
"dollars canadiens",
|
||||
"dollars",
|
||||
"livres",
|
||||
"francs suisses",
|
||||
"roubles",
|
||||
"pesos",
|
||||
"bitcoin",
|
||||
"anciens francs"
|
||||
]
|
||||
chosen = random.sample(currencies, k=2)
|
||||
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:
|
||||
log_error(f"Explore on bing: {activity} not found.")
|
||||
|
||||
@ -847,6 +902,7 @@ def default_start():
|
||||
try:
|
||||
config.WebDriver.set_pc_driver(create_driver())
|
||||
except:
|
||||
info("Could not configure driver. Trying to update it.")
|
||||
subprocess.Popen(["python3", "/app/MsRewards-Reborn/modules/Tools/update_chrome.py"])
|
||||
config.WebDriver.set_pc_driver(create_driver())
|
||||
config.WebDriver.switch_to_driver("PC")
|
||||
|
@ -15,6 +15,8 @@ try:
|
||||
except Exception as e:
|
||||
critical("Can't get version number from error")
|
||||
error(e)
|
||||
info("error message")
|
||||
info(errorMessage)
|
||||
exit(0)
|
||||
|
||||
info(f"Needed version : '{versionN}'")
|
||||
|
Reference in New Issue
Block a user