mirror of
				https://gitea.augustin64.fr/piair/MsRewards-Reborn.git
				synced 2025-11-04 15:43:53 +01:00 
			
		
		
		
	Compare commits
	
		
			4 Commits
		
	
	
		
			dev
			...
			200b0d8a86
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					200b0d8a86 | ||
| 
						 | 
					4a5af6455d | ||
| 
						 | 
					49b691d736 | ||
| 
						 | 
					9549a6dea3 | 
							
								
								
									
										14
									
								
								V6.py
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								V6.py
									
									
									
									
									
								
							@@ -152,7 +152,7 @@ def play_quiz4(override: int = None):
 | 
			
		||||
    except Exception as e:
 | 
			
		||||
        log_error(e)
 | 
			
		||||
        raise ValueError(e)
 | 
			
		||||
    info("Quiz 8 done.")
 | 
			
		||||
    info("Quiz 4 done.")
 | 
			
		||||
    custom_sleep(3)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -165,6 +165,8 @@ def do_poll():
 | 
			
		||||
        try:
 | 
			
		||||
            answer_elem.click()
 | 
			
		||||
        except exceptions.ElementNotInteractableException:
 | 
			
		||||
            warning("element not clickable. Waiting a bit and retrying.")
 | 
			
		||||
            custom_sleep(uniform(2, 2.5))
 | 
			
		||||
            driver.execute_script("arguments[0].click();", answer_elem)
 | 
			
		||||
        custom_sleep(uniform(2, 2.5))
 | 
			
		||||
    except Exception as err:
 | 
			
		||||
@@ -610,9 +612,11 @@ def daily_routine(cred: UserCredentials, custom=False):
 | 
			
		||||
    try:
 | 
			
		||||
        if not custom:  # custom already is logged in
 | 
			
		||||
            login()
 | 
			
		||||
 | 
			
		||||
    except Banned:
 | 
			
		||||
        log_error("This account is locked.")
 | 
			
		||||
        return
 | 
			
		||||
        raise Banned()
 | 
			
		||||
 | 
			
		||||
    except Identity:
 | 
			
		||||
        log_error("This account has an issue.")
 | 
			
		||||
        return
 | 
			
		||||
@@ -680,7 +684,7 @@ def json_start(json_entry, cred: UserCredentials):
 | 
			
		||||
                login()
 | 
			
		||||
            try:
 | 
			
		||||
                if str(account_id) in json_entry["tout"]:
 | 
			
		||||
                    daily_routine(cred)
 | 
			
		||||
                    daily_routine(cred, True)
 | 
			
		||||
            except KeyError:
 | 
			
		||||
                pass
 | 
			
		||||
            else:
 | 
			
		||||
@@ -744,12 +748,16 @@ def default_start():
 | 
			
		||||
            config.WebDriver.pc_driver.quit()
 | 
			
		||||
            config.display.stop()
 | 
			
		||||
            break
 | 
			
		||||
        except Banned:
 | 
			
		||||
            warning("this account is banned. Switching to next account")
 | 
			
		||||
        except Exception as e:
 | 
			
		||||
            log_error(f"Error not caught. Skipping this account. " + format_error(e))
 | 
			
		||||
            critical(f"Error not caught. Skipping this account. {e}")
 | 
			
		||||
            config.WebDriver.pc_driver.quit()
 | 
			
		||||
 | 
			
		||||
        finally:
 | 
			
		||||
            config.UserCredentials.next_account()
 | 
			
		||||
 | 
			
		||||
    config.display.stop()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -30,7 +30,7 @@ class DiscordLogger:
 | 
			
		||||
        )
 | 
			
		||||
        file = File("screenshot.png")
 | 
			
		||||
        embed.set_image(url="attachment://screenshot.png")
 | 
			
		||||
        embed.set_footer(text=self.config.UserCredentials.creds.get_mail())
 | 
			
		||||
        embed.set_footer(text=self.config.UserCredentials.get_mail() + " - " + self.config.WebDriver.current_driver())
 | 
			
		||||
 | 
			
		||||
        self.config.discord.wh.send(embed=embed, username="error", file=file, avatar_url=self.config.discord.avatar_url)
 | 
			
		||||
        self.config.discord.wh.send(username="error", file=File("page.html"), avatar_url=self.config.discord.avatar_url)
 | 
			
		||||
 
 | 
			
		||||
@@ -20,3 +20,6 @@ class Driver:
 | 
			
		||||
 | 
			
		||||
            case _:
 | 
			
		||||
                raise ValueError("The driver must be either pc or mobile")
 | 
			
		||||
 | 
			
		||||
    def current_driver(self):
 | 
			
		||||
        return "PC" if self.pc_driver == self.driver else "Mobile"
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ class UserCredentials:
 | 
			
		||||
    def get_tfa(self):
 | 
			
		||||
        if not self.tfa_enable():
 | 
			
		||||
            warning("Warning: TFA is not enabled. Calling get_tfa is an expected behaviour.")
 | 
			
		||||
        return TOTP(self.data[self.current]["tfa"])
 | 
			
		||||
        return TOTP(self.data[self.current]["2fa"])
 | 
			
		||||
 | 
			
		||||
    def next_account(self):
 | 
			
		||||
        self.current += 1
 | 
			
		||||
 
 | 
			
		||||
@@ -30,7 +30,7 @@ class ColoredFormatter(logging.Formatter):
 | 
			
		||||
 | 
			
		||||
# Set up the root logger
 | 
			
		||||
root_logger = logging.getLogger(__name__)
 | 
			
		||||
root_logger.setLevel(logging.DEBUG)
 | 
			
		||||
root_logger.setLevel(logging.INFO)
 | 
			
		||||
 | 
			
		||||
# Create a console handler and set the formatter
 | 
			
		||||
ch = logging.StreamHandler()
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ def get_domain(driver):
 | 
			
		||||
 | 
			
		||||
def custom_sleep(temps):
 | 
			
		||||
    try:
 | 
			
		||||
        if True:  # todo: change this awful condition
 | 
			
		||||
        if False:  # todo: change this awful condition
 | 
			
		||||
            points = ["⢿", "⣻", "⣽", "⣾", "⣷", "⣯", "⣟", "⡿"]
 | 
			
		||||
            passe = 0
 | 
			
		||||
            for _ in range(int(temps)):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user