mirror of
https://gitea.augustin64.fr/piair/MsRewards-Reborn.git
synced 2025-06-25 10:53:58 +02:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
ecd5a9f204 | |||
2b1c7b985e | |||
c9c93e9828 | |||
1a4ed4f4e7 | |||
0ba92798ad | |||
4aef2bf948 | |||
68395f4314 | |||
2ca2779ec9 | |||
5ef8d8b7ca | |||
f2d08e9137 | |||
d946298a38 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,7 +1,6 @@
|
||||
/old
|
||||
geckodriver.log
|
||||
.vscode/
|
||||
update.sh
|
||||
/Git
|
||||
page.html
|
||||
screenshot.png
|
||||
@ -11,5 +10,5 @@ data
|
||||
/user_data
|
||||
install.sh
|
||||
nohup.out
|
||||
test.py
|
||||
points.csv
|
||||
/dev
|
||||
|
127
CODE_OF_CONDUCT.md
Normal file
127
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,127 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at piair338@gmail.com.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
92
README.md
92
README.md
@ -1,46 +1,50 @@
|
||||
# MsReward
|
||||
|
||||
|
||||
A Microsoft reward automator, designed to work headless on any server.
|
||||
A Microsoft reward automator, designed to work headless on any x64 server.
|
||||
Using a discord webhook or SQL to log points everyday.
|
||||
Using Selenium and Geckodriver.
|
||||
# Installation instruction
|
||||
Make sure your contry is [supported by MS Rewards](https://support.microsoft.com/en-us/topic/microsoft-rewards-regions-9795ec47-c0f4-a33e-aede-738903359d63).
|
||||
Create 5 Microsoft accounts, that the programm will use.
|
||||
- [linux](#linux)
|
||||
- [Windows](#windows)
|
||||
- [MacOS](#macos)
|
||||
- [Database configuration](#database)
|
||||
- [Options](#options)
|
||||
- [Flags](#flags)
|
||||
## Linux
|
||||
|
||||
## If you're using docker (way easier)
|
||||
to use docker, run
|
||||
### Using docker (Recommended)
|
||||
Make sure that [docker](https://docs.docker.com/get-docker/) and [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) are installed.
|
||||
Clone the repository:
|
||||
```
|
||||
sudo docker build .
|
||||
#copy the build id
|
||||
sudo docker run -ti --name MsRewards [build id]
|
||||
git clone https://github.com/piair338/MsRewards
|
||||
```
|
||||
Then, fill the config and start the program everyday with
|
||||
Build the docker container:
|
||||
```
|
||||
sudo docker start MsRewards
|
||||
cd MsRewards
|
||||
sudo docker build -t msrewards .
|
||||
```
|
||||
Run the app for the first time to configure it.
|
||||
```
|
||||
sudo docker run -ti --name MsRewards msrewards
|
||||
```
|
||||
Then to run it everyday, you can use cron and add the line:
|
||||
```
|
||||
10 10 * * * sudo docker start MsRewards
|
||||
```
|
||||
|
||||
## Other configuration
|
||||
|
||||
To use the database, I recommend MySql, Create a database with the name you want and create a table `daily`, like the one from the image :
|
||||

|
||||
|
||||
You have to use the default world list (`sudo apt install wfrench`). The language is french by default, but you can change it if you want.
|
||||
You can add a link to a website where content is only the link of the monthly fidelity card.
|
||||
|
||||
|
||||
You should limit to 6 account per IP, and DON'T USE outlook account, they are banned.
|
||||

|
||||
|
||||
## If you're **not** using docker
|
||||
|
||||
installation recommandation :
|
||||
### **not** using docker (not recommended)
|
||||
**This is only a recommandation and shouldn't be used !**
|
||||
```
|
||||
sudo apt-get install xdg-utils libdbus-glib-1-2 bzip2 wfrench tigervnc-standalone-server -y
|
||||
sudo apt-get install xdg-utils libdbus-glib-1-2 bzip2 wfrench tigervnc-standalone-server xvnc -y
|
||||
|
||||
curl -sSLO https://download-installer.cdn.mozilla.net/pub/firefox/releases/91.9.1esr/linux-x86_64/en-US/firefox-91.9.1esr.tar.bz2
|
||||
tar -xjf firefox-91.9.1esr.tar.bz2
|
||||
sudo mv firefox /opt/
|
||||
sudo ln -s /opt/firefox/firefox /usr/bin/firefox
|
||||
|
||||
|
||||
curl -sSLO https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz
|
||||
tar zxf geckodriver-v0.31.0-linux64.tar.gz
|
||||
sudo mv geckodriver /usr/bin/
|
||||
@ -48,3 +52,41 @@ sudo mv geckodriver /usr/bin/
|
||||
rm geckodriver-v0.31.0-linux64.tar.gz
|
||||
rm firefox-91.9.1esr.tar.bz2
|
||||
```
|
||||
## Windows
|
||||
Not yet tested, but using docker should work.
|
||||
## MacOS
|
||||
I don't have a mac (yet) so i can't test, but again, install docker and follow the linux installation.
|
||||
|
||||
# Database
|
||||
|
||||
To use the database, I recommend MySql, Create a database with the name `MsRewards` and create a table `daily`, like the one from the image :
|
||||

|
||||
|
||||
# Options
|
||||
TODO
|
||||
# Flags
|
||||
## Override
|
||||
Enable you to choose what action to perform on which account. **Linux only**
|
||||
```
|
||||
python3 main.py -o
|
||||
```
|
||||
## VNC
|
||||
Enble a vnc to a specific port
|
||||
```
|
||||
python3 main.py -v 1234
|
||||
```
|
||||
## config
|
||||
Tell the programm which config to use.
|
||||
Default to ./user_data/config.cfg
|
||||
Putting only a number is equivalent to ./user_data/config[number].cfg
|
||||
```
|
||||
python3 main.py -c 12
|
||||
```
|
||||
## Add points to database
|
||||
Add points to the database using the credentials provided in the default config file.
|
||||
argument : file with a list of `account,points`
|
||||
```
|
||||
python3 main.py -a file.csv
|
||||
```
|
||||
|
||||
|
||||
|
137
V5.py
137
V5.py
@ -28,12 +28,14 @@ def firefox_driver(mobile=False, headless=False):
|
||||
options.set_preference('intl.accept_languages', 'fr-FR, fr')
|
||||
options.set_preference("browser.link.open_newwindow", 3)
|
||||
options.set_preference("dom.confirm_repost.testing.always_accept", True)
|
||||
if g.fast:
|
||||
options.set_preference("permissions.default.image", 2)
|
||||
if headless:
|
||||
options.add_argument("-headless")
|
||||
if mobile :
|
||||
options.set_preference("general.useragent.override", MOBILE_USER_AGENT)
|
||||
driver = webdriver.Firefox(options=options)
|
||||
driver.set_window_size(1070 + hash(g._mail)%20 , 1900 + hash(g._password + "salt")%10) # mobile resolution are crazy high now, right ?
|
||||
driver.set_window_size(1070 + hash(g._mail)%10 , 1900 + hash(g._password + "salt")%20) # mobile resolution are crazy high now, right ?
|
||||
else :
|
||||
options.set_preference("general.useragent.override", PC_USER_AGENT)
|
||||
driver = webdriver.Firefox(options=options)
|
||||
@ -221,30 +223,39 @@ def all_cards():
|
||||
promo()
|
||||
except Exception as e:
|
||||
printf("no promo card")
|
||||
if(len(liste) < 10): #most likely an error during loading
|
||||
driver.refresh()
|
||||
liste = driver.find_elements(By.CLASS_NAME, "c-card-content")
|
||||
if(len(liste) < 10):
|
||||
log_error("moins de 10 cartes", driver)
|
||||
if (len(liste) < 20):
|
||||
if not g.norvege :
|
||||
log_error("Less than 10 cards. Most likely an error with login.", driver)
|
||||
return("PAS ASSEZ DE CARTES")
|
||||
if (len(liste) < 20): # most likely not in france
|
||||
if not g.norvege : # TODO : rename norvege to not_france or smth like that
|
||||
g.norvege = True
|
||||
printf("moins de 20 cartes, disabling fidelity")
|
||||
g.fidelity_link = "Disabled because norway"
|
||||
log_error("Verifying if Norway", driver, True)
|
||||
printf("Most likely not in France, thus disabling France specific action")
|
||||
# TODO : check country for fidelity
|
||||
for i in range(len(liste)):
|
||||
printf(f"carte {i}")
|
||||
try :
|
||||
checked = ("mee-icon-AddMedium" in liste[i].get_attribute("innerHTML"))
|
||||
except StaleElementReferenceException :
|
||||
driver.refresh()
|
||||
liste = driver.find_elements(By.CLASS_NAME, "c-card-content")
|
||||
printf(f"staled, {len(liste)}")
|
||||
checked = ("mee-icon-AddMedium" in liste[i].get_attribute("innerHTML"))
|
||||
except IndexError:
|
||||
log_error("IndexError ?", driver)
|
||||
driver.refresh()
|
||||
driver.get("https://rewards.bing.com")
|
||||
custom_sleep(10)
|
||||
liste = driver.find_elements(By.CLASS_NAME, "c-card-content")
|
||||
try :
|
||||
checked = ("mee-icon-AddMedium" in liste[i].get_attribute("innerHTML"))
|
||||
except :
|
||||
log_error("IndexError", driver)
|
||||
return("INDEX ERROR")
|
||||
if checked:
|
||||
custom_sleep(3)
|
||||
custom_sleep(1.5)
|
||||
driver.execute_script("arguments[0].scrollIntoView();", liste[i])
|
||||
custom_sleep(1.5)
|
||||
liste[i].click()
|
||||
if len(driver.window_handles) > 1 :
|
||||
driver.switch_to.window(driver.window_handles[1])
|
||||
@ -255,11 +266,17 @@ def all_cards():
|
||||
liste = driver.find_elements(By.CLASS_NAME, "c-card-content")
|
||||
if ("mee-icon-AddMedium" in liste[i].get_attribute("innerHTML")) :
|
||||
printf(f"carte {i} not okay. Retrying.")
|
||||
try :
|
||||
liste[i].click()
|
||||
log_error(f"Card {i} with issue. WTF ?", driver)
|
||||
except :
|
||||
log_error("problème inconnu ? sauf si c'est un element obscure...", driver)
|
||||
driver.get("https://rewards.bing.com")
|
||||
checked = ("mee-icon-AddMedium" in liste[i].get_attribute("innerHTML"))
|
||||
driver.switch_to.window(driver.window_handles[1])
|
||||
try_play(driver.title)
|
||||
close_tab(driver.window_handles[1])
|
||||
if ("mee-icon-AddMedium" in liste[i].get_attribute("innerHTML")):
|
||||
log_error(f"Card {i} Can't be completed. Why MS ?", driver)
|
||||
except :
|
||||
pass
|
||||
else :
|
||||
@ -278,7 +295,11 @@ def promo():
|
||||
break
|
||||
if i > 8 :
|
||||
log_error("chelou, plus de 8 truc", driver)
|
||||
try :
|
||||
elm.click()
|
||||
except :
|
||||
driver.execute_script("arguments[0].click();", elm)
|
||||
printf("that should't be there (promo)")
|
||||
custom_sleep(3)
|
||||
if len(driver.window_handles) > 1 :
|
||||
driver.switch_to.window(driver.window_handles[len(driver.window_handles)-1])
|
||||
@ -288,8 +309,9 @@ def promo():
|
||||
try :
|
||||
spotify(driver)
|
||||
except :
|
||||
log_error("no new windows", driver)
|
||||
printf("no new windows", driver)
|
||||
driver.get("https://rewards.bing.com")
|
||||
driver.refresh()
|
||||
custom_sleep(3)
|
||||
|
||||
|
||||
@ -322,7 +344,7 @@ def try_play(nom="inconnu"):
|
||||
except Exception as e:
|
||||
printf(f"fail of PlayQuiz 2. Aborted {e}")
|
||||
else:
|
||||
log_error("There is an error. rqAnswerOption present in page but no action to do. skipping.")
|
||||
printf("There is an error. rqAnswerOption present in page but no action to do. skipping.")
|
||||
|
||||
try:
|
||||
if wait_until_visible(By.ID, "rqStartQuiz", 5, driver):
|
||||
@ -390,6 +412,9 @@ def cookie_login(ldriver):
|
||||
except FileNotFoundError :
|
||||
printf("No cookies file Found.")
|
||||
return(False)
|
||||
except Exception as e:
|
||||
log_error(f"Error performing cookies login. Trying with password instead. \n{str(e)}", driver)
|
||||
return(False)
|
||||
try :
|
||||
ldriver.refresh()
|
||||
except Exception as e:
|
||||
@ -404,6 +429,12 @@ def login_part_2(ldriver, cookies = False):
|
||||
custom_sleep(5)
|
||||
if ('Abuse' in ldriver.current_url) :
|
||||
raise Banned()
|
||||
if ('identity' in ldriver.current_url) :
|
||||
raise Identity()
|
||||
if ('notice' in ldriver.current_url) :
|
||||
ldriver.find_element(By.ID, "id__0").click()
|
||||
if ("proof" in ldriver.current_url):
|
||||
ldriver.find_element(BY.ID, "iLooksGood")
|
||||
if cookies:
|
||||
save_cookies(ldriver)
|
||||
for id in ["KmsiCheckboxField", "id__0", "iLooksGood", "idSIButton9", "iCancel"]:
|
||||
@ -419,14 +450,7 @@ def login_part_2(ldriver, cookies = False):
|
||||
rgpd_popup(ldriver)
|
||||
ldriver.refresh()
|
||||
rgpd_popup(ldriver)
|
||||
#ldriver.get("https://account.microsoft.com/")
|
||||
#if wait_until_visible(By.CSS_SELECTOR, '[data-bi-id="sh-sharedshell-home"]', 30, ldriver) :
|
||||
# return(True) #the account logging was successful
|
||||
#else :
|
||||
# log_error("Error during login. Trying to refresh")
|
||||
# ldriver.refresh()
|
||||
# return(wait_until_visible(By.CSS_SELECTOR, '[data-bi-id="sh-sharedshell-home"]', 30, ldriver))
|
||||
# useless ?
|
||||
|
||||
|
||||
# login() tries to login to your Microsoft account.
|
||||
# it uses global variable g._mail and g._password to login
|
||||
@ -439,6 +463,8 @@ def login(ldriver):
|
||||
ldriver.get("https://rewards.bing.com/")
|
||||
except Banned:
|
||||
raise Banned()
|
||||
except Identity:
|
||||
raise Banned()
|
||||
except Exception as e:
|
||||
log_error(e)
|
||||
ldriver.quit()
|
||||
@ -559,41 +585,26 @@ def log_points(account="unknown"):
|
||||
webhookSuccess.send(f"{account_name} actuellement à {str(points)} points")
|
||||
|
||||
if g.sql_enabled :
|
||||
try :
|
||||
add_to_database(account_name, points, g.sql_host, g.sql_usr, g.sql_pwd, g.sql_database)
|
||||
except Exception as e:
|
||||
if g.database_error_override:
|
||||
printf("database error.")
|
||||
else :
|
||||
log_error(e)
|
||||
|
||||
|
||||
def fidelity():
|
||||
def sub_fidelity():
|
||||
try:
|
||||
while 1: #close all tabs
|
||||
try:
|
||||
close_tab(1)
|
||||
except:
|
||||
break
|
||||
try :
|
||||
fidelity_link_page = get(g.fidelity_link) #get the url of fidelity page
|
||||
except Exception as e :
|
||||
printf(e)
|
||||
fidelity_link_page = False
|
||||
|
||||
if fidelity_link_page :
|
||||
fidelity_link = fidelity_link_page.content.decode("UTF-8")
|
||||
|
||||
if (fidelity_link.split(":")[0] == "https") or (fidelity_link.split(":")[0] == "http") :
|
||||
driver.get(fidelity_link)
|
||||
wait_until_visible(By.CSS_SELECTOR, 'div[class="pull-left spacer-48-bottom punchcard-row"]', browser=driver)
|
||||
try :
|
||||
choix = driver.find_element(By.CSS_SELECTOR, 'div[class="pull-left spacer-48-bottom punchcard-row"]') # pull-left spacer-48-bottom punchcard-row? USELESS ?
|
||||
except : # tentative de fix
|
||||
driver.execute_script("location.reload(true);")
|
||||
wait_until_visible(By.CSS_SELECTOR, 'div[class="pull-left spacer-48-bottom punchcard-row"]', browser=driver)
|
||||
choix = driver.find_element(By.CSS_SELECTOR, 'div[class="pull-left spacer-48-bottom punchcard-row"]')
|
||||
answer_number = search("([0-9]) of ([0-9]) completed", driver.page_source)
|
||||
if answer_number is None :
|
||||
answer_number = search("([0-9]) défi\(s\) terminé\(s\) sur ([0-9])", driver.page_source)
|
||||
if answer_number is None:
|
||||
answer_number = search("([0-9]) de ([0-9]) finalisé", driver.page_source)
|
||||
if answer_number is None :
|
||||
answer_number = search("([0-9]) licence\(s\) sur ([0-9]) disponible\(s\)", driver.page_source)
|
||||
if answer_number is None :
|
||||
answer_number = search("([0-9]) défi\(s\) terminé\(s\) sur ([0-9])", driver.page_source)
|
||||
if answer_number is None :
|
||||
answer_number = [0,0,0]
|
||||
for _ in range(int(answer_number[2]) - int(answer_number[1])):
|
||||
@ -612,20 +623,38 @@ def fidelity():
|
||||
log_error(f"fidélité - double erreur - e1 : {format_error(e1)} - e2 {format_error(e2)}")
|
||||
break
|
||||
custom_sleep(uniform(3, 5))
|
||||
driver.switch_to.window(driver.window_handles[1])
|
||||
driver.switch_to.window(driver.window_handles[2])
|
||||
try_play(driver.title)
|
||||
driver.get(fidelity_link) # USELESS ?
|
||||
custom_sleep(uniform(3, 5))
|
||||
try:
|
||||
close_tab(driver.window_handles[1])
|
||||
close_tab(driver.window_handles[2], 1)
|
||||
except Exception as e:
|
||||
printf(e)
|
||||
printf("fidelity - done")
|
||||
else :
|
||||
printf("invalid fidelity link.")
|
||||
except Exception as e:
|
||||
log_error(e)
|
||||
|
||||
if driver.current_url != "https://rewards.bing.com":
|
||||
driver.get("https://rewards.bing.com")
|
||||
pause = driver.find_element(By.CSS_SELECTOR, f'[class="c-action-toggle c-glyph f-toggle glyph-pause"]') # mettre le truc en pause
|
||||
pause.click()
|
||||
cartes = driver.find_elements(By.CSS_SELECTOR, f'[ng-repeat="item in $ctrl.transcludedItems"]')
|
||||
nb_cartes = len(cartes)
|
||||
checked_list_all = driver.find_elements(By.CSS_SELECTOR, f'[ng-if="$ctrl.complete"]')
|
||||
for i in range(nb_cartes):
|
||||
cartes[i].click() # affiche la bonne carte
|
||||
checked_txt = checked_list_all[i].get_attribute("innerHTML")
|
||||
ok = checked_txt.count("StatusCircleOuter checkmark")
|
||||
total = checked_txt.count("StatusCircleOuter")
|
||||
if (ok != total) :
|
||||
elm = driver.find_elements(By.CLASS_NAME, 'clickable-link')[i]
|
||||
if not "moviesandtv" in elm.get_attribute("innerHTML"): # not the film card
|
||||
elm.click()
|
||||
driver.switch_to.window(driver.window_handles[len(driver.window_handles)-1])
|
||||
sub_fidelity()
|
||||
close_tab(driver.window_handles[1])
|
||||
custom_sleep(1)
|
||||
cartes = driver.find_elements(By.CSS_SELECTOR, f'[ng-repeat="item in $ctrl.transcludedItems"]')
|
||||
checked_list_all = driver.find_elements(By.CSS_SELECTOR, f'[ng-if="$ctrl.complete"]')
|
||||
|
||||
def mobile_alert_popup():
|
||||
try:
|
||||
@ -674,6 +703,9 @@ def daily_routine(custom = False):
|
||||
except Banned :
|
||||
log_error("This account is locked. Fix that. (-U ?)", driver)
|
||||
return()
|
||||
except Identity :
|
||||
log_error("This account has an issue. Fix that.", driver)
|
||||
return()
|
||||
|
||||
try:
|
||||
all_cards()
|
||||
@ -702,7 +734,8 @@ def daily_routine(custom = False):
|
||||
|
||||
|
||||
def dev():
|
||||
input("dev pause")
|
||||
pass
|
||||
|
||||
|
||||
|
||||
def CustomStart():
|
||||
|
27
main.py
27
main.py
@ -34,7 +34,7 @@ def confirm(texte, default = False):
|
||||
return False
|
||||
return default
|
||||
|
||||
lang = "fr"
|
||||
lang = "en"
|
||||
|
||||
text = {"fr" : {
|
||||
"compte" : "entrer l'adresse mail du compte ",
|
||||
@ -55,6 +55,24 @@ text = {"fr" : {
|
||||
"proxye" : "voulez vous utiliser un proxy ",
|
||||
"proxyl" : "entrez le lien du proxy ",
|
||||
"proxyp" : "entrez le port du proxy "
|
||||
},
|
||||
"en" : {
|
||||
"compte" : "enter email of an account",
|
||||
"mdp" : "enter password of this account ",
|
||||
"next" : "Add another account ? ",
|
||||
"finc" : "Adding accounts ",
|
||||
"ajout" : "Accounts added ",
|
||||
"discorde" : "Do you want to use discord ? (Highly recommended as it's untested without)",
|
||||
"w1" : "Enter Webhook link for sending points everyday",
|
||||
"w2" : "Enter Webhook link for errors ",
|
||||
"msqle" : "Do you want to use a database ? ",
|
||||
"msqll" : "database link ",
|
||||
"msqlu" : "database username ",
|
||||
"msqlp" : "database password ",
|
||||
"msqlt" : "database name (should be MsRewards) ",
|
||||
"proxye" : "Do you want to use a proxy ",
|
||||
"proxyl" : "Proxy address ",
|
||||
"proxyp" : "Proxy port "
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +110,7 @@ def edit_config_txt(ligne, contenu):
|
||||
txt = f.readlines()
|
||||
f.close()
|
||||
if txt.count(txt) >1:
|
||||
raise NameError("il y a plus d'une occurence, echec de la modification")
|
||||
raise NameError("Fail")
|
||||
|
||||
for i in range(len(txt)) :
|
||||
name = txt[i].split(" = ")[0]
|
||||
@ -106,16 +124,11 @@ def edit_config_txt(ligne, contenu):
|
||||
|
||||
|
||||
def setup_settings():
|
||||
general()
|
||||
discord()
|
||||
proxy()
|
||||
sql()
|
||||
|
||||
|
||||
def general():
|
||||
if confirm(t["fidelity"]):
|
||||
lien = input(t["lien"])
|
||||
edit_config_txt('FidelityLink',lien)
|
||||
|
||||
|
||||
def discord():
|
||||
|
@ -151,6 +151,15 @@ g.sql_host = config["SQL"]["host"]
|
||||
g.sql_database = config["SQL"]["database"]
|
||||
|
||||
|
||||
try :
|
||||
g.database_error_override = config["OTHER"]["database_override"] == "True"
|
||||
except :
|
||||
pass
|
||||
|
||||
try :
|
||||
g.fast = config["OTHER"]["fast"] == "True"
|
||||
except :
|
||||
pass
|
||||
h = open(g.mot_path, "r", encoding="utf-8")
|
||||
lines = h.readlines()
|
||||
if len(lines) < 3 :
|
||||
|
@ -3,3 +3,6 @@ class Banned(Exception):
|
||||
|
||||
class NotBanned(Exception):
|
||||
pass
|
||||
|
||||
class Identity(Exception):
|
||||
pass
|
@ -34,3 +34,5 @@ sql_host = "https://example.com"
|
||||
sql_database = "MsRewards"
|
||||
dev = False
|
||||
norvege = False
|
||||
database_error_override = False
|
||||
fast = False
|
||||
|
@ -5,7 +5,6 @@ logpath = /your/path/to/loginandpass.csv
|
||||
|
||||
[SETTINGS]
|
||||
|
||||
FidelityLink = Null
|
||||
embeds = False
|
||||
Headless = True
|
||||
|
||||
@ -31,5 +30,8 @@ usr = root
|
||||
pwd = password
|
||||
|
||||
[OTHER]
|
||||
|
||||
avatar = https://cdn.discordapp.com/icons/793934298977009674/d8055bccef6eca4855c349e808d0d788.webp
|
||||
ipv6 = False
|
||||
database_override = False
|
||||
fast = False
|
||||
|
Reference in New Issue
Block a user