Compare commits

..

No commits in common. "db157771def588aa5b2791e31e3c416e54b86f34" and "9af0f4aadbb7bdf05bb9fc1277f40c0a47e6182a" have entirely different histories.

3 changed files with 10 additions and 41 deletions

View File

@ -15,7 +15,7 @@ RUN apt install -y libgtk-4-1 libvulkan1 libxdamage1 \
# Additional repos and packages # Additional repos and packages
RUN wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb \ RUN wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb \
&& dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb && dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
RUN curl -sSL http://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/google-chrome-stable_123.0.6312.86-1_amd64.deb -o chrome.deb \ RUN curl -sSLO https://nc.piair.xyz/s/BKLsBWoZkTdYjfq/download/chrome.deb \
&& dpkg -i chrome.deb && dpkg -i chrome.deb
RUN ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime RUN ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime
RUN wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key \ RUN wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key \
@ -25,14 +25,12 @@ RUN curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyri
RUN apt update \ RUN apt update \
&& apt install -y redis grafana && apt install -y redis grafana
COPY requirements.txt /app/requirements.txt
RUN python3 -m pip install -r requirements.txt
# Setup app # Setup app
RUN git clone https://gitea.augustin64.fr/piair/MsRewards-Reborn RUN git clone https://gitea.augustin64.fr/piair/MsRewards-Reborn
# Use this instead when developping locally: # Use this instead when developping locally:
# COPY . /app/MsRewards-Reborn # COPY . /app/MsRewards-Reborn
RUN python3 -m pip install -r MsRewards-Reborn/requirements.txt
RUN bash MsRewards-Reborn/config/config.sh RUN bash MsRewards-Reborn/config/config.sh
ENV TZ="Europe/Paris" ENV TZ="Europe/Paris"

41
V6.py
View File

@ -1,4 +1,4 @@
#!/usr/bin/python3 #!/usr/bin/python3.10
from modules.Classes.Config import Config from modules.Classes.Config import Config
from modules.Classes.DiscordLogger import DiscordLogger from modules.Classes.DiscordLogger import DiscordLogger
from modules.Classes.UserCredentials import UserCredentials from modules.Classes.UserCredentials import UserCredentials
@ -9,7 +9,6 @@ from modules.db import add_to_database
from modules.driver_tools import * from modules.driver_tools import *
from modules.error import * from modules.error import *
import os
# create a webdriver # create a webdriver
def create_driver(mobile=False): def create_driver(mobile=False):
@ -23,34 +22,14 @@ def create_driver(mobile=False):
"AppleWebKit/537.36 (KHTML, like Gecko)" "AppleWebKit/537.36 (KHTML, like Gecko)"
"Chrome/22 Mobile Safari/537.36" "Chrome/22 Mobile Safari/537.36"
) )
chrome_options = webdriver.ChromeOptions()
# Profile dir
chrome_profile_dir = "/app/MsRewards-Reborn/user_data/profile/"+config.UserCredentials.get_mail()
os.makedirs(chrome_profile_dir, exist_ok=True)
# Full list on https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md
arguments = [
"--no-first-run",
"--ash-no-nudges",
"--no-default-browser-check",
"--disable-features=PrivacySandboxSettings4,Translate",
"--disable-search-engine-choice-screen",
f"--user-data-dir={chrome_profile_dir}/"
]
if mobile: if mobile:
arguments.append(f"--user-agent={mobile_user_agent}") chrome_options.add_argument(f"--user-agent={mobile_user_agent}")
else: else:
arguments.append(f"--user-agent={pc_user_agent}") chrome_options.add_argument(f"--user-agent={pc_user_agent}")
# disabled as it may cause detection # disabled as it may cause detection
if config.proxy.is_enabled(): if config.proxy.is_enabled():
arguments.append(f'--proxy-server={config.proxy.ip}:{config.proxy.port}') chrome_options.add_argument(f'--proxy-server={config.proxy.ip}:{config.proxy.port}')
chrome_options = webdriver.ChromeOptions()
for arg in arguments:
chrome_options.add_argument(arg)
driver = uc.Chrome(options=chrome_options) driver = uc.Chrome(options=chrome_options)
set_language(driver) set_language(driver)
return driver return driver
@ -213,7 +192,7 @@ def all_cards():
info("no promo card") info("no promo card")
if len(card_list) < 10: # most likely an error during loading if len(card_list) < 10: # most likely an error during loading
if "suspendu" in driver.page_source or "suspended" in driver.page_source: if "suspendu" in driver.page_source:
raise Banned() raise Banned()
driver.refresh() driver.refresh()
card_list = driver.find_elements(By.CLASS_NAME, "c-card-content") card_list = driver.find_elements(By.CLASS_NAME, "c-card-content")
@ -433,16 +412,8 @@ def login_part_2():
# login() tries to login to your Microsoft account. # login() tries to login to your Microsoft account.
# it uses global variable g._mail and g._password to login # it uses global variable g._mail and g._password to login
def login(): def login():
def logged_in():
driver.get("https://login.live.com")
custom_sleep(10)
if get_domain(driver) == "account.microsoft.com":
return True
return False
driver = config.WebDriver.driver driver = config.WebDriver.driver
try: try:
if not logged_in():
login_part_1() login_part_1()
login_part_2() login_part_2()
driver.get("https://rewards.bing.com/") driver.get("https://rewards.bing.com/")

View File

@ -1 +1 @@
v6.8.43 v6.8.42