diff --git a/V6.py b/V6.py index 8da7f99..3ea0de5 100755 --- a/V6.py +++ b/V6.py @@ -457,26 +457,22 @@ def bing_pc_search(override=randint(35, 40)): log_error(f"clear la barre de recherche - {format_error(e)}") # what is this message ??? todo -# Sends points to database, discord and whatever service you want -# todo: refactor +# Sends current account's points to database def log_points(): driver = config.WebDriver.driver account = config.UserCredentials.get_mail() - def get_points(): - driver.get("https://rewards.bing.com") - custom_sleep(1) - wait_until_visible(By.CSS_SELECTOR, 'span[mee-element-ready="$ctrl.loadCounterAnimation()"]', browser=driver) - try: - point = search('availablePoints\":([\d]+)', driver.page_source)[1] - except Exception as e: - log_error( - f"Dev error, checking why it doesn't work (waited a bit, is this still white ?) {format_error(e)}") - error("Can't get points.") - return -1 - return point + driver.get("https://rewards.bing.com") + custom_sleep(1) + wait_until_visible(By.CSS_SELECTOR, 'span[mee-element-ready="$ctrl.loadCounterAnimation()"]', browser=driver) + try: + points = search('availablePoints\":([\d]+)', driver.page_source)[1] + except Exception as err: + log_error( + f"Dev error, checking why it doesn't work (waited a bit, is this still white ?) {format_error(err)}") + error(f"Can't get points. {format_error(err)}") + return -1 - points = get_points() custom_sleep(uniform(3, 20)) account_name = account.split("@")[0] diff --git a/version b/version index e1bef45..cb09dfa 100644 --- a/version +++ b/version @@ -1 +1 @@ -v6.8.22 +v6.8.23