Compare commits

..

No commits in common. "master" and "fix4" have entirely different histories.
master ... fix4

4 changed files with 44 additions and 125 deletions

View File

@ -1,5 +1,5 @@
FROM python:3.10
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /app/
# Initial apt install

91
V6.py
View File

@ -200,10 +200,6 @@ def do_poll():
def all_cards():
driver = config.WebDriver.driver
def check_popups() -> bool:
"""
Check various annoying popups
"""
def check_welcome_tour() -> bool:
if "rewards.bing.com/welcometour" not in driver.current_url:
return False
@ -240,27 +236,6 @@ def all_cards():
# les éléments sont présents dans le DOM même quand la popup n'est pas visible apparemment
return False
def check_streak_protection_expired() -> bool:
"""
Non, vous avez utilisé tous vos jours de protection contre les séries !
"""
try:
streak_protection_close = driver.find_element(By.ID, "streak-protection-popup-close-cross")
ok_sad_button = driver.find_elements(By.CLASS_NAME, "dashboardPopUpPopUpSelectButton")
ok_sad_button[0].click()
info("Popup 'Streak Protection fully used' reçue")
custom_sleep(1.5)
return True
except (exceptions.NoSuchElementException, exceptions.ElementNotInteractableException, IndexError):
return False
return (
check_welcome_tour()
or check_streak_protection()
or check_streak_protection_expired()
)
driver.get("https://rewards.bing.com")
wait_until_visible(By.CLASS_NAME, "c-card-content", 10, driver)
@ -314,7 +289,8 @@ def all_cards():
activity = ""
custom_sleep(1.5)
check_popups()
check_welcome_tour()
check_streak_protection()
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
custom_sleep(1.5)
card_list[i].click()
@ -331,7 +307,8 @@ def all_cards():
if "mee-icon-AddMedium" not in card_list[i].get_attribute("innerHTML"):
continue
check_popups()
check_welcome_tour()
check_streak_protection()
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
card_list[i].click()
@ -447,59 +424,7 @@ def explore_on_bing(activity: str, config: Config):
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'][randint(0, 1)]} package tracking")
elif "hotel" in activity:
search_bing(f" {['Paris', 'Nice', 'Marseille', 'Bordeaux', 'Lyon'][randint(0, 4)]}")
elif "health" in activity:
search_bing(f"{['toux', 'douleur dos', 'nez qui coule', 'mal au genoux', 'otite'][randint(0, 4)]}")
elif "news" in activity:
search_bing(["actualités", "news"][randint(0, 1)])
elif "jobs" in activity:
search_bing("jobs")
elif "realestate" in activity:
search_bing(f"appartement à louer {['Paris', 'Nice', 'Marseille', 'Bordeaux', 'Lyon'][randint(0, 4)]}")
elif "financemarket" in activity:
search_bing(
f"cours action {['AIR LIQUIDE', 'Airbus', 'BNP Paribas', 'Michelin', 'Stellantis', 'Vinci'][randint(0, 5)]}")
elif "sports" in activity:
equipes = random.sample([
"Toulon", "toulouse",
"stade Rochelais", "castres",
"clermont", "perpignan",
"aviron bayonnais", "vannes"
], k=2)
search_bing(f"{['score', 'résultats'][randint(0, 1)]} rugby {equipes[0]} {equipes[1]}")
elif "videogames" in activity:
search_bing(random.choice([
"Minecraft", "GTA V",
"Tetris", "PUBG",
"Mario Kart 8",
"Red Dead Redemption II",
"Terraria",
"The Witcher",
"Animal Crossing",
"Pokémon rouge & bleu",
"Super Mario Bros",
"The legend of Zelda BOTW",
"Call of Duty Modern Warfare",
"The Witcher III"
]))
elif "dictionary" in activity:
search_bing(f"définition {config.wordlist.get_word()}")
elif "election" in activity or "timezonedates" in activity:
#! I don't understand the name of "timezonedates" but this seems to be the same activity
state = random.choice([
"Alaska", "Alabama", "Arkansas", "American Samoa", "Arizona", "California", "Colorado",
"Connecticut", "District ", "of Columbia", "Delaware", "Florida", "Georgia", "Guam",
"Hawaii", "Iowa", "Idaho", "Illinois", "Indiana", "Kansas", "Kentucky", "Louisiana",
"Massachusetts", "Maryland", "Maine", "Michigan", "Minnesota", "Missouri", "Mississippi",
"Montana", "North Carolina", "North Dakota", "Nebraska", "New Hampshire", "New Jersey",
"New Mexico", "Nevada", "New York", "Ohio", "Oklahoma", "Oregon", "Pennsylvania",
"Puerto Rico", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas",
"Utah", "Virginia", "Virgin Islands", "Vermont", "Washington", "Wisconsin",
"West Virginia", "Wyoming"
])
search_bing(f"governor candidates {state} 2024")
search_bing(f"{['fedex', 'UPS', '']} package tracking")
else:
log_error(f"Explore on bing: {activity} not found.")
@ -565,8 +490,6 @@ def try_play(nom="unknown", activity=""):
info(f"Explore on bing: {activity}")
explore_on_bing(activity, config)
custom_sleep(uniform(3, 5))
elif "Optimisez votre sécurité avec Microsoft" in driver.page_source:
info("Still not paying Office 365 ?")
else:
info(f"Nothing obvious to do on page `{nom}`.")
custom_sleep(uniform(3, 5))
@ -578,15 +501,11 @@ def login_part_1():
info("Starting part 1 of login")
driver = config.WebDriver.driver
driver.get("https://login.live.com")
try:
wait_until_visible(By.ID, "i0116", browser=driver)
send_wait_and_confirm(
driver.find_element(By.ID, "i0116"),
config.UserCredentials.get_mail()
)
except exceptions.NoSuchElementException:
info("Unable to find mail input for login, might be semi-logged-in")
wait_until_visible(By.ID, "i0118", browser=driver)
send_wait_and_confirm(
driver.find_element(By.ID, "i0118"),

View File

@ -5,7 +5,7 @@ import subprocess
from logger import critical, info, error
errorMessage = subprocess.run(['python3', '/app/MsRewards-Reborn/modules/Tools/generate_error.py'], check=False, stdout=subprocess.PIPE,
errorMessage = subprocess.run(['python3', 'generate_error.py'], check=False, stdout=subprocess.PIPE,
stderr=subprocess.PIPE).stderr.decode("utf-8")
versionPattern = "This version of ChromeDriver only supports Chrome version ([0-9]+)"

View File

@ -1 +1 @@
v6.8.65
v6.8.57