From fbb2feae31ea089f54924911fe93a76876acdfb0 Mon Sep 17 00:00:00 2001 From: piair Date: Fri, 14 Apr 2023 10:31:12 +0200 Subject: [PATCH] small but infinite error --- Dockerfile | 3 ++- V5.py | 9 +++++++-- version | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1a6b1a0..d034bd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,11 +4,11 @@ ENV DEBIAN_FRONTEND noninteractive ENV GECKODRIVER_VER v0.31.0 ENV FIREFOX_VER 87.0 WORKDIR /app - RUN set -x \ && apt update \ && apt upgrade -y \ && apt install -y \ + tzdata \ wfrench \ git \ libx11-xcb1 \ @@ -31,6 +31,7 @@ RUN set -x \ && mv geckodriver /usr/bin/ +ENV TZ="Europe/Paris" WORKDIR /app/MsRewards CMD python main.py diff --git a/V5.py b/V5.py index 60befd0..2ab77b7 100755 --- a/V5.py +++ b/V5.py @@ -283,18 +283,23 @@ def spotify(): def promo(): elm = driver.find_element(By.ID, "promo-item") - while elm: + for i in range(10): + if not elm: + break + if i > 8 : + log_error("chelou, plus de 8 truc", driver) driver.execute_script("arguments[0].click();", elm) custom_sleep(3) if len(driver.window_handles) > 1 : driver.switch_to.window(driver.window_handles[len(driver.window_handles)-1]) - try_play() + try_play(driver.title) close_tab(driver.window_handles[1]) else : try : spotify() except : log_error("no new windows", driver) + driver.get("https://rewards.bing.com") custom_sleep(3) # Find out which type of action to do diff --git a/version b/version index b589c59..dc79f12 100644 --- a/version +++ b/version @@ -1 +1 @@ -v5.8.1 +v5.8.2