Compare commits
No commits in common. "01416c0e1193a6fa9af056ae2896c8814b628554" and "80286b6a057d026c752e2ec6b004bd586069cd00" have entirely different histories.
01416c0e11
...
80286b6a05
|
@ -1,2 +0,0 @@
|
|||
**/.venv
|
||||
user_data/*
|
|
@ -1,18 +1,12 @@
|
|||
dev_build.sh
|
||||
/old
|
||||
geckodriver.log
|
||||
.vscode/
|
||||
.idea
|
||||
venv
|
||||
**/.venv
|
||||
update.sh
|
||||
/Git
|
||||
page.html
|
||||
screenshot.png
|
||||
login.csv
|
||||
requirements.txt
|
||||
data
|
||||
**/__pycache__
|
||||
user_data/*
|
||||
install.sh
|
||||
nohup.out
|
||||
file.png
|
||||
*.ts
|
||||
LICENSE
|
||||
README.md
|
||||
/user_data
|
||||
|
|
62
Dockerfile
62
Dockerfile
|
@ -1,43 +1,31 @@
|
|||
FROM python:3.10
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
WORKDIR /app/
|
||||
ENV GECKODRIVER_VER v0.31.0
|
||||
ENV FIREFOX_VER 87.0
|
||||
WORKDIR /app
|
||||
|
||||
# Initial apt install
|
||||
RUN apt update
|
||||
RUN apt install -y libgtk-4-1 libvulkan1 libxdamage1 \
|
||||
novnc websockify xvfb nginx nano tzdata \
|
||||
sqlite3 apt-transport-https software-properties-common \
|
||||
wget wfrench tigervnc-standalone-server libasound2 \
|
||||
libatk-bridge2.0-0 libnss3 libnspr4 xvfb libgbm1 libatk1.0-0 \
|
||||
libu2f-udev libatspi2.0-0 libcups2 libxkbcommon0 libxrandr2 \
|
||||
libdbus-1-3 xdg-utils fonts-liberation libdrm2
|
||||
RUN set -x \
|
||||
&& apt update \
|
||||
&& apt upgrade -y \
|
||||
&& apt install -y \
|
||||
wfrench \
|
||||
git \
|
||||
&& git clone https://github.com/piair338/MsRewards \
|
||||
&& pip install -r MsRewards/requirements.txt \
|
||||
&& apt install -y \
|
||||
libx11-xcb1 \
|
||||
libdbus-glib-1-2 \
|
||||
&& 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 -jxf firefox-* \
|
||||
&& mv firefox /opt/ \
|
||||
&& chmod 755 /opt/firefox \
|
||||
&& chmod 755 /opt/firefox/firefox \
|
||||
&& curl -sSLO https://github.com/mozilla/geckodriver/releases/download/${GECKODRIVER_VER}/geckodriver-${GECKODRIVER_VER}-linux64.tar.gz \
|
||||
&& tar zxf geckodriver-*.tar.gz \
|
||||
&& mv geckodriver /usr/bin/
|
||||
|
||||
# Additional repos and packages
|
||||
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
|
||||
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 \
|
||||
&& dpkg -i chrome.deb
|
||||
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 \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | tee -a /etc/apt/sources.list.d/grafana.list
|
||||
RUN curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
|
||||
# Install from new repo
|
||||
RUN apt update \
|
||||
&& apt install -y redis grafana
|
||||
|
||||
# Configure Grafana
|
||||
RUN grafana-cli plugins install frser-sqlite-datasource
|
||||
WORKDIR /app/MsReward
|
||||
CMD python main.py
|
||||
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
RUN python3 -m pip install -r requirements.txt
|
||||
|
||||
# Setup app
|
||||
RUN git clone https://gitea.augustin64.fr/piair/MsRewards-Reborn
|
||||
# Use this instead when developping locally:
|
||||
# COPY . /app/MsRewards-Reborn
|
||||
|
||||
RUN bash MsRewards-Reborn/config/config.sh
|
||||
|
||||
ENV TZ="Europe/Paris"
|
||||
WORKDIR /app/MsRewards-Reborn/Flask/
|
||||
CMD bash start.sh
|
||||
|
|
471
Flask/app.py
471
Flask/app.py
|
@ -1,471 +0,0 @@
|
|||
import gevent.monkey
|
||||
gevent.monkey.patch_all()
|
||||
from time import sleep
|
||||
import subprocess
|
||||
import os
|
||||
from flask import Flask, Response, redirect, url_for, request, session, abort, render_template, send_from_directory
|
||||
from apscheduler.schedulers.background import BackgroundScheduler
|
||||
from apscheduler.triggers.cron import CronTrigger
|
||||
from flask_login import LoginManager, UserMixin, login_required, login_user, logout_user
|
||||
from werkzeug.utils import secure_filename
|
||||
import json
|
||||
import re
|
||||
from requests import get
|
||||
import redis
|
||||
|
||||
APP_ROOT = os.getenv("APP_ROOT")
|
||||
if APP_ROOT is None:
|
||||
APP_ROOT = "/app/MsRewards-Reborn/"
|
||||
|
||||
NO_SUBPROCESS = os.getenv("NO_SUBPROCESS")
|
||||
if NO_SUBPROCESS is not None:
|
||||
def fake_popen(*args, **kwargs):
|
||||
print("Calling subprocess.Popen with", args, kwargs)
|
||||
|
||||
subprocess.Popen = fake_popen
|
||||
print("Faking subprocess calls")
|
||||
|
||||
|
||||
|
||||
# redis part for live update
|
||||
pool = redis.ConnectionPool(host='localhost', port=6379, db=0)
|
||||
r = redis.Redis(connection_pool=pool)
|
||||
|
||||
def get_path(path):
|
||||
return os.path.join(APP_ROOT, path)
|
||||
|
||||
def generate_output():
|
||||
pubsub = r.pubsub()
|
||||
pubsub.subscribe('console')
|
||||
try :
|
||||
for message in pubsub.listen():
|
||||
if message['type'] == 'message':
|
||||
print(message)
|
||||
yield f"data: {message['data'].decode()}\n\n"
|
||||
except Exception as e:
|
||||
print(f"ya eu une erreur sad {e}")
|
||||
|
||||
# the end
|
||||
|
||||
global password
|
||||
with open(get_path("user_data/flask.json"), "r") as inFile:
|
||||
data = json.load(inFile)
|
||||
|
||||
password = data["password"]
|
||||
secret = data["secret"]
|
||||
if secret == "":
|
||||
import secrets
|
||||
secret = secrets.token_hex()
|
||||
with open(get_path("user_data/flask.json"), "w") as inFile:
|
||||
data = {
|
||||
"password": password,
|
||||
"secret": secret
|
||||
}
|
||||
json.dump(data, inFile)
|
||||
|
||||
"""
|
||||
#Automatic start of MsRewards
|
||||
"""
|
||||
def daily_command():
|
||||
subprocess.Popen(["git",'pull'])
|
||||
subprocess.Popen(["pkill","-9","chrome"])
|
||||
subprocess.Popen(["pkill","-9","Xvfb"])
|
||||
subprocess.Popen(["pkill","-9","Xvnc"])
|
||||
subprocess.Popen(["pkill","-9", "undetected_chromedriver"])
|
||||
|
||||
scheduler = BackgroundScheduler()
|
||||
scheduler.start()
|
||||
scheduler.add_job( # on relance le job
|
||||
daily_command, # ---
|
||||
trigger=CronTrigger(
|
||||
year="*", month="*", day="*", hour="0", minute="0", second="0"
|
||||
), # ---
|
||||
name="Daily refresh", # ---
|
||||
id="99" # ---
|
||||
)
|
||||
|
||||
def start_ms(i):
|
||||
print("\033[32m" + f"Starting config {i}" + "\033[0m")
|
||||
log = open(get_path(f"Flask/static/logs/{i}.txt"), 'a') # so that data written to it will be appended
|
||||
subprocess.Popen([f"python3 -u {get_path('V6.py')} -c {i}"], stdout=log, stderr=log, shell=True)
|
||||
log.close()
|
||||
|
||||
|
||||
TriggerDict = {}
|
||||
def update_jobs():
|
||||
with open(get_path("user_data/configs.json"), "r") as inFile:
|
||||
configs = json.load(inFile)
|
||||
for i in configs:
|
||||
try :
|
||||
h, m = configs[i]["time"].split(":")
|
||||
print("\033[36m" + f"config {i} : {h}:{m}" + "\033[0m")
|
||||
TriggerDict[i] = CronTrigger(
|
||||
year="*", month="*", day="*", hour=h, minute=m, second="0"
|
||||
)
|
||||
if configs[i]["enabled"]:
|
||||
try :
|
||||
scheduler.remove_job(i) # on reset le job
|
||||
except Exception as e:
|
||||
print(f"\033[33merror with deleting config {i} : {e}\033[0m")
|
||||
|
||||
try :
|
||||
scheduler.add_job( # on relance le job
|
||||
start_ms, # ---
|
||||
trigger=TriggerDict[i], # ---
|
||||
args=[i], # ---
|
||||
name="Daily start", # ---
|
||||
id=i # ---
|
||||
)
|
||||
print("\033[36m" + f"successfully created config {i}" + "\033[0m")
|
||||
except Exception as e:
|
||||
print(f"\033[33merror with creating config {i} : {e}\033[0m")
|
||||
else :
|
||||
try :
|
||||
scheduler.remove_job(i)
|
||||
except Exception as e :
|
||||
print(f"\033[33merror with deleting config {i} : {e}\033[0m")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
"""
|
||||
#Flask app
|
||||
"""
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.context_processor
|
||||
def inject_default_variables():
|
||||
with open(get_path("version"), "r") as f:
|
||||
version = f.readline().replace("\n", '')
|
||||
return dict(version=version)
|
||||
"""
|
||||
#Login stuff
|
||||
"""
|
||||
# config
|
||||
app.config["TEMPLATES_AUTO_RELOAD"] = True
|
||||
app.config.update(
|
||||
SECRET_KEY = secret
|
||||
)
|
||||
|
||||
login_manager = LoginManager()
|
||||
login_manager.init_app(app)
|
||||
login_manager.login_view = "login"
|
||||
|
||||
# silly user model
|
||||
class User(UserMixin):
|
||||
def __init__(self, id):
|
||||
self.id = id
|
||||
self.name = "user" + str(id)
|
||||
self.password = password
|
||||
|
||||
def __repr__(self):
|
||||
return "%d/%s/%s" % (self.id, self.name, self.password)
|
||||
|
||||
users = [User(1)]
|
||||
|
||||
@app.route('/stream')
|
||||
def stream():
|
||||
return Response(generate_output(), content_type='text/event-stream')
|
||||
|
||||
|
||||
@app.route("/login/", methods=["GET", "POST"])
|
||||
def login():
|
||||
if request.method == 'POST':
|
||||
if request.form['password'] == password:
|
||||
user = User(id)
|
||||
login_user(user)
|
||||
if password == "ChangeMe":
|
||||
return(redirect('/change_password'))
|
||||
return(redirect('/schedule'))
|
||||
else:
|
||||
return abort(401)
|
||||
else:
|
||||
return(render_template("login.html"))
|
||||
|
||||
|
||||
@app.route("/change_password/", methods=["GET", "POST"])
|
||||
@login_required
|
||||
def change_password():
|
||||
global password
|
||||
if request.method == 'POST':
|
||||
password = request.form["password"]
|
||||
subprocess.Popen(["grafana-cli", "admin", "reset-admin-password", password])
|
||||
with open(get_path("user_data/flask.json"), "w") as inFile:
|
||||
data = {
|
||||
"password": password,
|
||||
"secret": secret
|
||||
}
|
||||
json.dump(data, inFile)
|
||||
return(render_template("change_password.html"))
|
||||
|
||||
|
||||
# handle login failed
|
||||
@app.errorhandler(401)
|
||||
def unauthorized(e):
|
||||
return(redirect("/login"))
|
||||
|
||||
|
||||
# callback to reload the user object
|
||||
@login_manager.user_loader
|
||||
def load_user(userid):
|
||||
return User(userid)
|
||||
|
||||
"""
|
||||
#end of login stuff
|
||||
"""
|
||||
|
||||
@app.route("/")
|
||||
def main():
|
||||
with open(get_path("user_data/configs.json"), "r") as inFile:
|
||||
configs = json.load(inFile)
|
||||
return(render_template("schedule.html", data=configs))
|
||||
|
||||
|
||||
@app.route("/discord/")
|
||||
def discord_get():
|
||||
with open(get_path("user_data/discord.json"), "r") as inFile:
|
||||
data = json.load(inFile)
|
||||
return(render_template("discord.html", data=data, len=maxi(data)))
|
||||
|
||||
|
||||
@app.route("/discord/", methods=["post"])
|
||||
def discord_post():
|
||||
with open(get_path("user_data/discord.json"), "r") as inFile:
|
||||
data = json.load(inFile)
|
||||
action = request.form
|
||||
if action['DISCORD'] == "delete" :
|
||||
data.pop(action["select"], None)
|
||||
else :
|
||||
config = action["select"]
|
||||
successL = action["successL"]
|
||||
try :
|
||||
a = action["successT"]
|
||||
successT = "True"
|
||||
except:
|
||||
successT = "False"
|
||||
try :
|
||||
a = action["errorsT"]
|
||||
errorsT = "True"
|
||||
except:
|
||||
errorsT = "False"
|
||||
errorsL = action["errorsL"]
|
||||
name = action["name"] if action["name"] else f"unnamed{action['select']}"
|
||||
data[config] = {"errorsL" : errorsL, "errorsT": errorsT, "successT": successT, "successL": successL, "name": name}
|
||||
|
||||
with open(get_path("user_data/discord.json"), "w") as outFile:
|
||||
json.dump(data, outFile)
|
||||
return(render_template("discord.html", data=data, len=maxi(data)))
|
||||
|
||||
|
||||
@app.route("/dev/")
|
||||
def dev2():
|
||||
return(render_template("dev.html"))
|
||||
|
||||
|
||||
@app.route("/settings/")
|
||||
def settings_get():
|
||||
with open(get_path("user_data/settings.json"), "r") as inFile:
|
||||
settings = json.load(inFile)
|
||||
return(render_template("settings.html", data=settings))
|
||||
|
||||
|
||||
@app.route("/settings/", methods=["post"])
|
||||
def settings_post():
|
||||
settings = {}
|
||||
action = request.form
|
||||
settings['avatarlink'] = action["avatarlink"]
|
||||
with open(get_path("user_data/settings.json"), "w") as inFile:
|
||||
json.dump(settings, inFile)
|
||||
return(render_template("settings.html", data=settings))
|
||||
|
||||
|
||||
@app.route("/proxy/")
|
||||
def proxy_get():
|
||||
with open(get_path("user_data/proxy.json"), "r") as inFile:
|
||||
j = json.load(inFile)
|
||||
return(render_template("proxy.html", data=j, len=maxi(j)))
|
||||
|
||||
|
||||
@app.route("/proxy/", methods=["post"])
|
||||
def proxy_post():
|
||||
with open(get_path("user_data/proxy.json"), "r") as inFile:
|
||||
data = json.load(inFile)
|
||||
action = request.form
|
||||
print(action)
|
||||
if action['PROXY'] == "delete" :
|
||||
print(action)
|
||||
data.pop(action["select"], None)
|
||||
else :
|
||||
try :
|
||||
config = action["select"]
|
||||
address = action["address"]
|
||||
port = action["port"]
|
||||
name = action["name"] if action["name"] else f"@unnamed{action['select']}"
|
||||
data[config] = {"address" : address, "port": port, "name": name}
|
||||
except :
|
||||
print("error : probably bad config")
|
||||
|
||||
with open(get_path("user_data/proxy.json"), "w") as outFile:
|
||||
json.dump(data, outFile)
|
||||
return(render_template("proxy.html", data=data, len=maxi(data)))
|
||||
|
||||
|
||||
@app.route("/schedule/")
|
||||
def schedule_get():
|
||||
with open(get_path("user_data/configs.json"), "r") as inFile:
|
||||
configs = json.load(inFile)
|
||||
return(render_template("schedule.html", data=configs))
|
||||
|
||||
|
||||
@app.route("/schedule/", methods=["post"])
|
||||
def schedule_post():
|
||||
with open(get_path("user_data/configs.json"), "r") as inFile:
|
||||
configs = json.load(inFile)
|
||||
|
||||
data = dict(request.form)
|
||||
for i in configs:
|
||||
try :
|
||||
data[f'switch{i}']
|
||||
except :
|
||||
data[f'switch{i}'] = "off"
|
||||
|
||||
for i in configs:
|
||||
configs[i]["time"] = data[f"time{i}"]
|
||||
configs[i]["enabled"] = data[f"switch{i}"] == "on"
|
||||
|
||||
with open(get_path("user_data/configs.json"), "w") as inFile:
|
||||
json.dump(configs, inFile)
|
||||
update_jobs()
|
||||
return(render_template("schedule.html", data=configs))
|
||||
|
||||
|
||||
@app.route("/config/")
|
||||
def config_get():
|
||||
with open(get_path("user_data/proxy.json"), "r") as inFile:
|
||||
proxys = json.load(inFile)
|
||||
with open(get_path("user_data/discord.json"), "r") as inFile:
|
||||
discords = json.load(inFile)
|
||||
with open(get_path("user_data/configs.json"), "r") as inFile:
|
||||
configs = json.load(inFile)
|
||||
return(render_template("config.html", data=configs, discords=discords, proxys=proxys, configs=configs, len=maxi(configs)))
|
||||
|
||||
|
||||
@app.route("/config/", methods=["POST"])
|
||||
def config_post():
|
||||
action = request.form
|
||||
with open(get_path("user_data/proxy.json"), "r") as inFile:
|
||||
proxys = json.load(inFile)
|
||||
with open(get_path("user_data/discord.json"), "r") as inFile:
|
||||
discords = json.load(inFile)
|
||||
with open(get_path("user_data/configs.json"), "r") as inFile:
|
||||
configs = json.load(inFile)
|
||||
|
||||
if action["data"] == "delete":
|
||||
print(action["config"])
|
||||
configs.pop(action["config"])
|
||||
else :
|
||||
comptes = {
|
||||
"1":{"mail": action["mail1"], "pwd": action["pwd1"], "2fa": action["2fa1"]},
|
||||
"2":{"mail": action["mail2"], "pwd": action["pwd2"], "2fa": action["2fa2"]},
|
||||
"3":{"mail": action["mail3"], "pwd": action["pwd3"], "2fa": action["2fa3"]},
|
||||
"4":{"mail": action["mail4"], "pwd": action["pwd4"], "2fa": action["2fa4"]},
|
||||
"5":{"mail": action["mail5"], "pwd": action["pwd5"], "2fa": action["2fa5"]}
|
||||
}
|
||||
|
||||
configs[action["config"]] = {
|
||||
"name" : action["name"] if action["name"] != "" else f"unnamed{action['config']}",
|
||||
"proxy": action["proxy"],
|
||||
"discord": action["discord"],
|
||||
"time":"",
|
||||
"enabled":"False",
|
||||
"accounts": comptes
|
||||
}
|
||||
with open(get_path("user_data/configs.json"), "w") as outFile:
|
||||
json.dump(configs, outFile)
|
||||
return(render_template("config.html", data=configs, discords=discords, proxys=proxys, configs=configs, len=maxi(configs)))
|
||||
|
||||
@app.route("/logs/", methods=["GET", "POST"])
|
||||
def logs():
|
||||
with open(get_path("user_data/configs.json"), "r") as inFile:
|
||||
configs = json.load(inFile)
|
||||
|
||||
files = [(configs[i]["name"], i) for i in configs]
|
||||
config_files = [i[1] for i in files]
|
||||
for f in os.listdir(get_path("Flask/static/logs")):
|
||||
fid = ".".join(f.split(".")[:-1]) # filename without .txt
|
||||
if f != ".gitignore" and fid not in config_files:
|
||||
files.append((f, fid))
|
||||
|
||||
return render_template(
|
||||
"logs.html",
|
||||
files=files
|
||||
)
|
||||
|
||||
|
||||
@app.route("/stats/", methods=["GET", "POST"])
|
||||
def stats():
|
||||
return(render_template("stats.html"))
|
||||
|
||||
|
||||
@app.route("/override/", methods=["POST"])
|
||||
def override_post():
|
||||
json = request.form.to_dict(flat=False)
|
||||
log = open(get_path("Flask/static/logs/custom.txt"), 'w') # so that data written to it will be appended
|
||||
subprocess.Popen([f"python3 -u {get_path('V6.py')} -c {json['config'][0]} --json \"{json}\""], stdout=log, stderr=log, shell=True)
|
||||
log.close()
|
||||
return(render_template("vnc_post.html"))
|
||||
|
||||
@app.route("/override/", methods=["GET"])
|
||||
def override_get():
|
||||
with open(get_path("user_data/configs.json"), "r") as inFile:
|
||||
configs = json.load(inFile)
|
||||
return(render_template("vnc_get.html", configs=configs))
|
||||
|
||||
@app.route('/download/<path:filename>', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def download(filename):
|
||||
return send_from_directory(directory=get_path("user_data/"), path=filename, as_attachment=True)
|
||||
|
||||
|
||||
def allowed_file(filename):
|
||||
ALLOWED_EXTENSIONS = ["json"]
|
||||
return '.' in filename and \
|
||||
filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
|
||||
|
||||
@app.route('/upload_file/', methods=['POST'])
|
||||
@login_required
|
||||
def upload_file():
|
||||
print(request.files)
|
||||
i = 1
|
||||
while f'file{i}' in request.files :
|
||||
file = request.files[f'file{i}']
|
||||
if file.filename == '':
|
||||
print('end of files')
|
||||
return redirect(url_for('settings_get'))
|
||||
|
||||
elif file and allowed_file(file.filename):
|
||||
filename = secure_filename(file.filename)
|
||||
print(os.path.join(get_path("user_data/"), filename))
|
||||
file.save(os.path.join(get_path("user_data/"), filename))
|
||||
|
||||
i += 1
|
||||
print(i)
|
||||
print(f'file{i}' in request.files)
|
||||
print("requete bizarre")
|
||||
return redirect(url_for('settings_get'))
|
||||
|
||||
|
||||
def maxi(dict):
|
||||
m = 0
|
||||
for i in dict :
|
||||
if int(i) >= m:
|
||||
m = int(i)
|
||||
return(m+1)
|
||||
|
||||
|
||||
update_jobs()
|
||||
subprocess.Popen(["bash", get_path("config/request.sh")])
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
|
@ -1,5 +0,0 @@
|
|||
nohup redis-server &> nohup_redis.out &
|
||||
nohup bash /app/MsRewards-Reborn/sse.sh &> nohup_sse.out &
|
||||
service grafana-server start
|
||||
service nginx start
|
||||
gunicorn --reload --worker-class gevent -b 0.0.0.0:6666 'app:app'
|
|
@ -1,405 +0,0 @@
|
|||
@import url('https://fonts.googleapis.com/css?family=Montserrat');
|
||||
|
||||
/* Colors */
|
||||
:root {
|
||||
--color-background0: #212121;
|
||||
--color-background1: #212121;
|
||||
--color-background2: dimgray;
|
||||
--color-border0: #FFFFFF;
|
||||
--color-border1: grey;
|
||||
--color-text: #FFFFFF;
|
||||
--color-green: green;
|
||||
--color-lime: #BADA55;
|
||||
--color-red: red;
|
||||
--color-switch-button: #FFFFFF;
|
||||
--color-switch-background: grey;
|
||||
--color-transparent: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/* Sidebar size is the left panel size when opened */
|
||||
:root {
|
||||
--sidebar-size: max(20vw, 160px);
|
||||
--sidebar-sz-plus10: calc(var(--sidebar-size) + 10px);
|
||||
--sidebar-sz-plus30: calc(var(--sidebar-size) + 30px);
|
||||
}
|
||||
|
||||
html {
|
||||
text-align: center;
|
||||
font-family: Montserrat;
|
||||
height: 95%;
|
||||
}
|
||||
|
||||
form {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
iframe{
|
||||
border: none;
|
||||
}
|
||||
|
||||
input[type=text] {
|
||||
|
||||
width: 90%;
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
background-color: var(--color-background1);
|
||||
border: 2px solid var(--color-border1);
|
||||
border-radius: 4px;
|
||||
outline: none;
|
||||
color: var(--color-text);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input[type=password] {
|
||||
|
||||
width: 90%;
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
text-align: center;
|
||||
border: 2px solid var(--color-border1);
|
||||
border-radius: 4px;
|
||||
outline: none;
|
||||
color: var(--color-text);
|
||||
background-color: var(--color-background1);
|
||||
}
|
||||
|
||||
.button{
|
||||
border-radius: 4px;
|
||||
border: 2px solid var(--color-border1);
|
||||
background-color: var(--color-background1);
|
||||
color: var(--color-text);
|
||||
padding: 12px 20px;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.left-button{
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.ban{
|
||||
border-radius: 4px;
|
||||
border: 2px solid var(--color-red);
|
||||
background-size: 200% 100%;
|
||||
background-image: linear-gradient(to right, var(--color-background1) 50%, var(--color-red) 50%);
|
||||
-webkit-transition: background-position 0.5s;
|
||||
-moz-transition: background-position 0.5s;
|
||||
transition: background-position 0.5s;
|
||||
color: var(--color-text);
|
||||
padding: 12px 0px;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
}
|
||||
.ban:hover{
|
||||
background-position: -100% 0;
|
||||
}
|
||||
|
||||
.confirm{
|
||||
color: var(--color-text);
|
||||
padding: 12px 20px;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
background-size: 200% 100%;
|
||||
background-image: linear-gradient(to right, var(--color-background1) 50%, var(--color-green) 50%);
|
||||
-webkit-transition: background-position 0.5s;
|
||||
-moz-transition: background-position 0.5s;
|
||||
transition: background-position 0.5s;
|
||||
border: 2px solid var(--color-border1);
|
||||
}
|
||||
|
||||
.confirm:hover{
|
||||
background-position: -100% 0;
|
||||
}
|
||||
|
||||
.confirm{
|
||||
color: var(--color-text);
|
||||
padding: 12px 20px;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
background-size: 200% 100%;
|
||||
background-image: linear-gradient(to right, var(--color-background1) 50%, var(--color-green) 50%);
|
||||
-webkit-transition: background-position 0.5s;
|
||||
-moz-transition: background-position 0.5s;
|
||||
transition: background-position 0.5s;
|
||||
border: 2px solid var(--color-border1);
|
||||
}
|
||||
|
||||
.confirm:hover{
|
||||
background-position: -100% 0;
|
||||
}
|
||||
.unselected{
|
||||
border-radius: 4px;
|
||||
border: 2px solid var(--color-border1);
|
||||
background-color: var(--color-background1);
|
||||
color: var(--color-text);
|
||||
padding: 12px 20px;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
}
|
||||
.selected{
|
||||
border-radius: 4px;
|
||||
border: 2px solid var(--color-border1);
|
||||
background-color: var(--color-background2);
|
||||
color: var(--color-text);
|
||||
padding: 12px 20px;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
|
||||
button:hover{
|
||||
border: 2px solid var(--color-border0);
|
||||
cursor: pointer;
|
||||
}
|
||||
input:hover{
|
||||
border: 2px solid var(--color-border0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.submit{
|
||||
border-radius: 4px;
|
||||
border: 2px solid var(--color-border1);
|
||||
background-color: var(--color-background1);
|
||||
color: var(--color-text);
|
||||
padding: 12px 20px;
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--color-background0);
|
||||
color: var(--color-text);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.left-pannel{
|
||||
flex: 1;
|
||||
margin: 20px;
|
||||
border: 1px solid var(--color-border0);
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
width: 80%;
|
||||
height: 90%;
|
||||
|
||||
}
|
||||
|
||||
.content{
|
||||
flex: 3;
|
||||
margin: 20px;
|
||||
border: 1px solid var(--color-border0);
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
height: 90%;
|
||||
|
||||
}
|
||||
|
||||
.content > ul {
|
||||
display: inline-block;
|
||||
}
|
||||
.container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.row-item {
|
||||
margin: 10px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#image img {
|
||||
display: block;
|
||||
margin: auto;
|
||||
width: 20%;
|
||||
}
|
||||
.comlumn-name{
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
For toggle switch
|
||||
*/
|
||||
|
||||
|
||||
input.toogle[type=checkbox]{
|
||||
height: 0;
|
||||
width: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
label {
|
||||
padding: 8px;
|
||||
margin: auto;
|
||||
cursor: pointer;
|
||||
text-indent: -9999px;
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
background: var(--color-switch-background);
|
||||
display: block;
|
||||
border-radius: 100px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/*
|
||||
width: height of label /2 ;
|
||||
height: height of label /2px;
|
||||
*/
|
||||
label:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: var(--color-switch-button);
|
||||
border-radius: 90px;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
input:checked + label {
|
||||
background: var(--color-lime);
|
||||
}
|
||||
|
||||
input:checked + label:after {
|
||||
left: calc(100% - 5px);
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
/*changer l'épaisseur du click */
|
||||
label:active:after {
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
select {
|
||||
width: 90%;
|
||||
/*height: 100%;*/
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
background-color: var(--color-background1);
|
||||
border: 2px solid var(--color-border1);
|
||||
border-radius: 4px;
|
||||
outline: none;
|
||||
color: var(--color-text);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
select:hover {
|
||||
border: 2px solid var(--color-border0);
|
||||
}
|
||||
|
||||
|
||||
input[type="time"] {
|
||||
width: 70%;
|
||||
padding: 8px 12px;
|
||||
margin: 8px 0;
|
||||
background-color: var(--color-background1);
|
||||
border: 2px solid var(--color-border1);
|
||||
border-radius: 4px;
|
||||
outline: none;
|
||||
color: var(--color-text);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input[type="time"]::-webkit-calendar-picker-indicator {
|
||||
filter: invert(1);
|
||||
opacity: 0.7;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input[type="time"]::-webkit-calendar-picker-indicator:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
/** Sidebar stuff */
|
||||
#slide-sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
label[for="slide-sidebar"] {
|
||||
all: initial;
|
||||
z-index: 1; /* Always on top */
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
left: var(--sidebar-sz-plus30);
|
||||
|
||||
-moz-transition: left 0.5s ease;
|
||||
transition: left 0.5s ease;
|
||||
background: var(--color-transparent);
|
||||
}
|
||||
|
||||
label[for="slide-sidebar"]:after {
|
||||
all:unset;
|
||||
}
|
||||
|
||||
input:checked + label[for="slide-sidebar"] {
|
||||
background: var(--color-transparent);
|
||||
}
|
||||
|
||||
#slide {
|
||||
border-style: solid;
|
||||
border-radius: 4px;
|
||||
border-width: 1px;
|
||||
border-color: var(--color-border0);
|
||||
|
||||
color: var(--color-text);
|
||||
background-color: var(--color-background0);
|
||||
padding: 8px 8px 2px 8px;
|
||||
}
|
||||
|
||||
/* When opened behaviour */
|
||||
.left-pannel {
|
||||
width: var(--sidebar-size);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: var(--sidebar-sz-plus10);
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
-moz-transition: left 0.5s ease;
|
||||
transition: left 0.5s ease;
|
||||
|
||||
padding: 0 25px;
|
||||
background-color: var(--color-background0); /* we need no transparency when switching */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* When closed behaviour */
|
||||
input:checked#slide-sidebar~label {
|
||||
left: 20px;
|
||||
}
|
||||
|
||||
input:checked#slide-sidebar~.left-pannel {
|
||||
display: none;
|
||||
transition: display 0s 0.5s;
|
||||
}
|
||||
|
||||
input:checked#slide-sidebar~.content {
|
||||
left: 0;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#console {
|
||||
height: 100%;
|
||||
width: 20%;
|
||||
float: left;
|
||||
resize: horizontal;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#vnc-container {
|
||||
height: 100%;
|
||||
width: 80%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.container {
|
||||
height: 100%;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="50px" height="50px"><path d="M 21 0 C 19.355469 0 18 1.355469 18 3 L 18 5 L 10.1875 5 C 10.0625 4.976563 9.9375 4.976563 9.8125 5 L 8 5 C 7.96875 5 7.9375 5 7.90625 5 C 7.355469 5.027344 6.925781 5.496094 6.953125 6.046875 C 6.980469 6.597656 7.449219 7.027344 8 7 L 9.09375 7 L 12.6875 47.5 C 12.8125 48.898438 14.003906 50 15.40625 50 L 34.59375 50 C 35.996094 50 37.1875 48.898438 37.3125 47.5 L 40.90625 7 L 42 7 C 42.359375 7.003906 42.695313 6.816406 42.878906 6.503906 C 43.058594 6.191406 43.058594 5.808594 42.878906 5.496094 C 42.695313 5.183594 42.359375 4.996094 42 5 L 32 5 L 32 3 C 32 1.355469 30.644531 0 29 0 Z M 21 2 L 29 2 C 29.5625 2 30 2.4375 30 3 L 30 5 L 20 5 L 20 3 C 20 2.4375 20.4375 2 21 2 Z M 11.09375 7 L 38.90625 7 L 35.3125 47.34375 C 35.28125 47.691406 34.910156 48 34.59375 48 L 15.40625 48 C 15.089844 48 14.71875 47.691406 14.6875 47.34375 Z M 18.90625 9.96875 C 18.863281 9.976563 18.820313 9.988281 18.78125 10 C 18.316406 10.105469 17.988281 10.523438 18 11 L 18 44 C 17.996094 44.359375 18.183594 44.695313 18.496094 44.878906 C 18.808594 45.058594 19.191406 45.058594 19.503906 44.878906 C 19.816406 44.695313 20.003906 44.359375 20 44 L 20 11 C 20.011719 10.710938 19.894531 10.433594 19.6875 10.238281 C 19.476563 10.039063 19.191406 9.941406 18.90625 9.96875 Z M 24.90625 9.96875 C 24.863281 9.976563 24.820313 9.988281 24.78125 10 C 24.316406 10.105469 23.988281 10.523438 24 11 L 24 44 C 23.996094 44.359375 24.183594 44.695313 24.496094 44.878906 C 24.808594 45.058594 25.191406 45.058594 25.503906 44.878906 C 25.816406 44.695313 26.003906 44.359375 26 44 L 26 11 C 26.011719 10.710938 25.894531 10.433594 25.6875 10.238281 C 25.476563 10.039063 25.191406 9.941406 24.90625 9.96875 Z M 30.90625 9.96875 C 30.863281 9.976563 30.820313 9.988281 30.78125 10 C 30.316406 10.105469 29.988281 10.523438 30 11 L 30 44 C 29.996094 44.359375 30.183594 44.695313 30.496094 44.878906 C 30.808594 45.058594 31.191406 45.058594 31.503906 44.878906 C 31.816406 44.695313 32.003906 44.359375 32 44 L 32 11 C 32.011719 10.710938 31.894531 10.433594 31.6875 10.238281 C 31.476563 10.039063 31.191406 9.941406 30.90625 9.96875 Z"/></svg>
|
Before Width: | Height: | Size: 2.2 KiB |
|
@ -1,102 +0,0 @@
|
|||
function addline(ligne){
|
||||
var lplus = parseInt(ligne) + 1;
|
||||
document.getElementById("table").insertRow(lplus).insertCell(0).innerHTML = '<input type="file" id="file' + lplus + '" name="file' + lplus + '" onchange="addline(' + lplus + ')">'
|
||||
}
|
||||
|
||||
function change_discord(value, data, len) {
|
||||
if (value == len){
|
||||
document.getElementById("name").value = "";
|
||||
document.getElementById("submit").value = "Create !";
|
||||
document.getElementById("successT").checked = false;
|
||||
document.getElementById("errorsT").checked = false;
|
||||
document.getElementById("successL").value = "";
|
||||
document.getElementById("errorsL").value = "";
|
||||
}
|
||||
else {
|
||||
console.log(data[parseInt(value)]["successL"]);
|
||||
document.getElementById("submit").value = "Update";
|
||||
document.getElementById("successT").checked = data[parseInt(value)]["successT"] == "True";
|
||||
document.getElementById("errorsT").checked = data[parseInt(value)]["errorsT"] == "True";
|
||||
document.getElementById("successL").value = data[parseInt(value)]["successL"];
|
||||
document.getElementById("errorsL").value = data[parseInt(value)]["errorsL"];
|
||||
document.getElementById("name").value = data[parseInt(value)]["name"];
|
||||
}
|
||||
}
|
||||
|
||||
function delay(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
function change_config(value, data, len) {
|
||||
console.log(data[2]);
|
||||
document.getElementById("delete").style.visibility = "hidden";
|
||||
if (value == len){
|
||||
document.getElementById("submit").value = "Create !";
|
||||
document.getElementById("discord").value = "-1";
|
||||
document.getElementById("proxy").value = "-1";
|
||||
document.getElementById("name").value = "";
|
||||
for (let i = 1; i < 6; i++) {
|
||||
document.getElementById("mail"+ i).value = "";
|
||||
document.getElementById("pwd"+ i).value = "" ;
|
||||
document.getElementById("2fa"+ i).value = "" ;
|
||||
}
|
||||
}
|
||||
else {
|
||||
document.getElementById("delete").style.visibility = "visible";
|
||||
document.getElementById("submit").value = "Update !";
|
||||
document.getElementById("discord").value = data[parseInt(value)]["discord"];
|
||||
document.getElementById("proxy").value = data[parseInt(value)]["proxy"];
|
||||
document.getElementById("name").value = data[parseInt(value)]["name"];
|
||||
for (let i = 1; i < 6; i++) {
|
||||
document.getElementById("mail"+ i).value = data[parseInt(value)]['accounts'][i]["mail"] ;
|
||||
document.getElementById("pwd"+ i).value = data[parseInt(value)]['accounts'][i]["pwd"] ;
|
||||
document.getElementById("2fa"+ i).value = data[parseInt(value)]['accounts'][i]["2fa"] ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function change_proxy(value, data, len) {
|
||||
if (value == len){
|
||||
document.getElementById("submit").value = "Create";
|
||||
document.getElementById("address").value = "";
|
||||
document.getElementById("port").value = "";
|
||||
document.getElementById("name").value = "";
|
||||
}
|
||||
else {
|
||||
document.getElementById("submit").value = "Update";
|
||||
document.getElementById("address").value = data[parseInt(value)]["address"];
|
||||
document.getElementById("port").value = data[parseInt(value)]["port"];
|
||||
document.getElementById("name").value = data[parseInt(value)]["name"];
|
||||
}
|
||||
}
|
||||
|
||||
function change_override(value, data) {
|
||||
for (let i = 1; i < 6; i++) {
|
||||
document.getElementById("compte_"+ i).innerHTML = data[parseInt(value)]['accounts'][i]["mail"];
|
||||
if (!(data[parseInt(value)]['accounts'][i]["mail"])){
|
||||
console.log("hiding" + i);
|
||||
for (let j = 1; j <= 5; j++) {
|
||||
|
||||
document.getElementById(i.toString() +j.toString()).style.visibility = "hidden";
|
||||
}
|
||||
} else {
|
||||
console.log("showing" + i);
|
||||
for (let j = 1; j <= 5; j++) {
|
||||
console.log("element " + i.toString()+j.toString());
|
||||
document.getElementById(i.toString()+j.toString()).style.visibility = "visible";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function change_logs(value) {
|
||||
var myIframe = document.getElementById('embed');
|
||||
myIframe.addEventListener("load", function() {
|
||||
let doc = myIframe.contentDocument;
|
||||
doc.body.innerHTML = doc.body.innerHTML + '<style>html{color:white;}</style>';
|
||||
myIframe.contentWindow.scrollTo(0, myIframe.contentDocument.body.scrollHeight);
|
||||
});
|
||||
myIframe.src = "/static/logs/" + value + ".txt";
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
*.txt
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"name": "static",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/xterm": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/xterm/-/xterm-5.3.0.tgz",
|
||||
"integrity": "sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg=="
|
||||
},
|
||||
"node_modules/xterm-addon-fit": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/xterm-addon-fit/-/xterm-addon-fit-0.8.0.tgz",
|
||||
"integrity": "sha512-yj3Np7XlvxxhYF/EJ7p3KHaMt6OdwQ+HDu573Vx1lRXsVxOcnVJs51RgjZOouIZOczTsskaS+CpXspK81/DLqw==",
|
||||
"peerDependencies": {
|
||||
"xterm": "^5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FitAddon=t():e.FitAddon=t()}(self,(()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal)return;if(!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core,t=e._renderService.dimensions;if(0===t.css.cell.width||0===t.css.cell.height)return;const r=0===this._terminal.options.scrollback?0:e.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(i.getPropertyValue("height")),s=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),l=o-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),a=s-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-r;return{cols:Math.max(2,Math.floor(a/t.css.cell.width)),rows:Math.max(1,Math.floor(l/t.css.cell.height))}}}})(),e})()));
|
||||
//# sourceMappingURL=xterm-addon-fit.js.map
|
File diff suppressed because one or more lines are too long
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
"name": "xterm-addon-fit",
|
||||
"version": "0.8.0",
|
||||
"author": {
|
||||
"name": "The xterm.js authors",
|
||||
"url": "https://xtermjs.org/"
|
||||
},
|
||||
"main": "lib/xterm-addon-fit.js",
|
||||
"types": "typings/xterm-addon-fit.d.ts",
|
||||
"repository": "https://github.com/xtermjs/xterm.js",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"terminal",
|
||||
"xterm",
|
||||
"xterm.js"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "../../node_modules/.bin/tsc -p .",
|
||||
"prepackage": "npm run build",
|
||||
"package": "../../node_modules/.bin/webpack",
|
||||
"prepublishOnly": "npm run package"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"xterm": "^5.0.0"
|
||||
}
|
||||
}
|
|
@ -1,209 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
||||
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
||||
* https://github.com/chjj/term.js
|
||||
* @license MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* Originally forked from (with the author's permission):
|
||||
* Fabrice Bellard's javascript vt100 for jslinux:
|
||||
* http://bellard.org/jslinux/
|
||||
* Copyright (c) 2011 Fabrice Bellard
|
||||
* The original design remains. The terminal itself
|
||||
* has been extended to include xterm CSI codes, among
|
||||
* other features.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Default styles for xterm.js
|
||||
*/
|
||||
|
||||
.xterm {
|
||||
cursor: text;
|
||||
position: relative;
|
||||
user-select: none;
|
||||
-ms-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
.xterm.focus,
|
||||
.xterm:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.xterm .xterm-helpers {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
/**
|
||||
* The z-index of the helpers must be higher than the canvases in order for
|
||||
* IMEs to appear on top.
|
||||
*/
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.xterm .xterm-helper-textarea {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
/* Move textarea out of the screen to the far left, so that the cursor is not visible */
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
left: -9999em;
|
||||
top: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
z-index: -5;
|
||||
/** Prevent wrapping so the IME appears against the textarea at the correct position */
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.xterm .composition-view {
|
||||
/* TODO: Composition position got messed up somewhere */
|
||||
background: #000;
|
||||
color: #FFF;
|
||||
display: none;
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.xterm .composition-view.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.xterm .xterm-viewport {
|
||||
/* On OS X this is required in order for the scroll bar to appear fully opaque */
|
||||
background-color: #000;
|
||||
overflow-y: scroll;
|
||||
cursor: default;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.xterm .xterm-screen {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.xterm .xterm-screen canvas {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.xterm .xterm-scroll-area {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.xterm-char-measure-element {
|
||||
display: inline-block;
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -9999em;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.xterm.enable-mouse-events {
|
||||
/* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.xterm.xterm-cursor-pointer,
|
||||
.xterm .xterm-cursor-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.xterm.column-select.focus {
|
||||
/* Column selection mode */
|
||||
cursor: crosshair;
|
||||
}
|
||||
|
||||
.xterm .xterm-accessibility,
|
||||
.xterm .xterm-message {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
color: transparent;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.xterm .live-region {
|
||||
position: absolute;
|
||||
left: -9999px;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.xterm-dim {
|
||||
/* Dim should not apply to background, so the opacity of the foreground color is applied
|
||||
* explicitly in the generated class and reset to 1 here */
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
.xterm-underline-1 { text-decoration: underline; }
|
||||
.xterm-underline-2 { text-decoration: double underline; }
|
||||
.xterm-underline-3 { text-decoration: wavy underline; }
|
||||
.xterm-underline-4 { text-decoration: dotted underline; }
|
||||
.xterm-underline-5 { text-decoration: dashed underline; }
|
||||
|
||||
.xterm-overline {
|
||||
text-decoration: overline;
|
||||
}
|
||||
|
||||
.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
|
||||
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
|
||||
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
|
||||
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
|
||||
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
|
||||
|
||||
.xterm-strikethrough {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.xterm-screen .xterm-decoration-container .xterm-decoration {
|
||||
z-index: 6;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
|
||||
z-index: 7;
|
||||
}
|
||||
|
||||
.xterm-decoration-overview-ruler {
|
||||
z-index: 8;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.xterm-decoration-top {
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,100 +0,0 @@
|
|||
{
|
||||
"name": "xterm",
|
||||
"description": "Full xterm terminal, in your browser",
|
||||
"version": "5.3.0",
|
||||
"main": "lib/xterm.js",
|
||||
"style": "css/xterm.css",
|
||||
"types": "typings/xterm.d.ts",
|
||||
"repository": "https://github.com/xtermjs/xterm.js",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"cli",
|
||||
"command-line",
|
||||
"console",
|
||||
"pty",
|
||||
"shell",
|
||||
"ssh",
|
||||
"styles",
|
||||
"terminal-emulator",
|
||||
"terminal",
|
||||
"tty",
|
||||
"vt100",
|
||||
"webgl",
|
||||
"xterm"
|
||||
],
|
||||
"scripts": {
|
||||
"prepackage": "npm run build",
|
||||
"package": "webpack",
|
||||
"package-headless": "webpack --config ./webpack.config.headless.js",
|
||||
"postpackage-headless": "node ./bin/package_headless.js",
|
||||
"start": "node demo/start",
|
||||
"build-demo": "webpack --config ./demo/webpack.config.js",
|
||||
"start-debug": "node --inspect-brk demo/start",
|
||||
"lint": "eslint -c .eslintrc.json --max-warnings 0 --ext .ts src/ addons/",
|
||||
"lint-api": "eslint --no-eslintrc -c .eslintrc.json.typings --max-warnings 0 --no-ignore --ext .d.ts typings/",
|
||||
"test": "npm run test-unit",
|
||||
"posttest": "npm run lint",
|
||||
"test-api": "npm run test-api-chromium",
|
||||
"test-api-chromium": "node ./bin/test_api.js --browser=chromium --timeout=20000",
|
||||
"test-api-firefox": "node ./bin/test_api.js --browser=firefox --timeout=20000",
|
||||
"test-api-webkit": "node ./bin/test_api.js --browser=webkit --timeout=20000",
|
||||
"test-playwright": "playwright test -c ./out-test/playwright/playwright.config.js --workers 4",
|
||||
"test-playwright-chromium": "playwright test -c ./out-test/playwright/playwright.config.js --workers 4 --project='Chrome Stable'",
|
||||
"test-playwright-firefox": "playwright test -c ./out-test/playwright/playwright.config.js --workers 4 --project='Firefox Stable'",
|
||||
"test-playwright-webkit": "playwright test -c ./out-test/playwright/playwright.config.js --workers 4 --project='WebKit'",
|
||||
"test-playwright-debug": "playwright test -c ./out-test/playwright/playwright.config.js --headed --workers 1 --timeout 30000",
|
||||
"test-unit": "node ./bin/test.js",
|
||||
"test-unit-coverage": "node ./bin/test.js --coverage",
|
||||
"test-unit-dev": "cross-env NODE_PATH='./out' mocha",
|
||||
"build": "tsc -b ./tsconfig.all.json",
|
||||
"install-addons": "node ./bin/install-addons.js",
|
||||
"presetup": "npm run install-addons",
|
||||
"setup": "npm run build",
|
||||
"prepublishOnly": "npm run package",
|
||||
"watch": "tsc -b -w ./tsconfig.all.json --preserveWatchOutput",
|
||||
"benchmark": "NODE_PATH=./out xterm-benchmark -r 5 -c test/benchmark/benchmark.json",
|
||||
"benchmark-baseline": "NODE_PATH=./out xterm-benchmark -r 5 -c test/benchmark/benchmark.json --baseline out-test/benchmark/test/benchmark/*benchmark.js",
|
||||
"benchmark-eval": "NODE_PATH=./out xterm-benchmark -r 5 -c test/benchmark/benchmark.json --eval out-test/benchmark/test/benchmark/*benchmark.js",
|
||||
"clean": "rm -rf lib out addons/*/lib addons/*/out",
|
||||
"vtfeatures": "node bin/extract_vtfeatures.js src/**/*.ts src/*.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.37.1",
|
||||
"@types/chai": "^4.2.22",
|
||||
"@types/debug": "^4.1.7",
|
||||
"@types/deep-equal": "^1.0.1",
|
||||
"@types/express": "4",
|
||||
"@types/express-ws": "^3.0.1",
|
||||
"@types/glob": "^7.2.0",
|
||||
"@types/jsdom": "^16.2.13",
|
||||
"@types/mocha": "^9.0.0",
|
||||
"@types/node": "^18.16.0",
|
||||
"@types/utf8": "^3.0.0",
|
||||
"@types/webpack": "^5.28.0",
|
||||
"@types/ws": "^8.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.2.00",
|
||||
"@typescript-eslint/parser": "^6.2.00",
|
||||
"chai": "^4.3.4",
|
||||
"cross-env": "^7.0.3",
|
||||
"deep-equal": "^2.0.5",
|
||||
"eslint": "^8.45.0",
|
||||
"eslint-plugin-jsdoc": "^39.3.6",
|
||||
"express": "^4.17.1",
|
||||
"express-ws": "^5.0.2",
|
||||
"glob": "^7.2.0",
|
||||
"jsdom": "^18.0.1",
|
||||
"mocha": "^10.1.0",
|
||||
"mustache": "^4.2.0",
|
||||
"node-pty": "^0.10.1",
|
||||
"nyc": "^15.1.0",
|
||||
"source-map-loader": "^3.0.0",
|
||||
"source-map-support": "^0.5.20",
|
||||
"ts-loader": "^9.3.1",
|
||||
"typescript": "^5.1.6",
|
||||
"utf8": "^3.0.0",
|
||||
"webpack": "^5.61.0",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"ws": "^8.2.3",
|
||||
"xterm-benchmark": "^0.3.1"
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
"name": "static",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"xterm": "^5.3.0",
|
||||
"xterm-addon-fit": "^0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/xterm": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/xterm/-/xterm-5.3.0.tgz",
|
||||
"integrity": "sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg=="
|
||||
},
|
||||
"node_modules/xterm-addon-fit": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/xterm-addon-fit/-/xterm-addon-fit-0.8.0.tgz",
|
||||
"integrity": "sha512-yj3Np7XlvxxhYF/EJ7p3KHaMt6OdwQ+HDu573Vx1lRXsVxOcnVJs51RgjZOouIZOczTsskaS+CpXspK81/DLqw==",
|
||||
"peerDependencies": {
|
||||
"xterm": "^5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"xterm": "^5.3.0",
|
||||
"xterm-addon-fit": "^0.8.0"
|
||||
}
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta charset="utf-8">
|
||||
<link rel="icon" type="image/png" href="{{ url_for('static', filename='favicon.ico') }}">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>MS Rewards</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/flask.css')}}"/>
|
||||
<script src="{{ url_for('static', filename='js/main.js')}}"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<input id="slide-sidebar" type="checkbox" role="button"/>
|
||||
<label for="slide-sidebar">
|
||||
<div id="slide">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-menu-2" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||
<path d="M4 6l16 0"></path>
|
||||
<path d="M4 12l16 0"></path>
|
||||
<path d="M4 18l16 0"></path>
|
||||
</svg>
|
||||
</div>
|
||||
</label>
|
||||
<div class="left-pannel">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" id="sidebar_schedule" onclick="location.href = '/schedule';">schedule</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" id="sidebar_config" onclick="location.href = '/config';">config</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" id="sidebar_discord" onclick="location.href = '/discord';">discord</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" id="sidebar_proxy" onclick="location.href = '/proxy';">proxy</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" id="sidebar_logs" onclick="location.href = '/logs';">logs</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" id="sidebar_stats" onclick="location.href = '/stats';">stats</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" id="sidebar_override" onclick="location.href = '/override';">Override</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" id="sidebar_settings" onclick="location.href = '/settings';">settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script>document.getElementById("sidebar_{% block left_pannel %}{% endblock %}").className = "selected"</script>
|
||||
</div>
|
||||
<div class="content">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">{{version}}</div>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,22 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% block left_pannel %}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<h1>Already logged in</h1>
|
||||
{% else %}
|
||||
<form method="post" action="/change_password/">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="comlumn-name">Change password</td>
|
||||
<td><input type="text" name="password"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" name="NewPassword" value="send" class="button"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,106 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% block left_pannel %}config{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block content %}
|
||||
<script>data2 = JSON.parse('{{configs|tojson}}'); </script>
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<form method="post" action="/config/">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 10%;">config : </td>
|
||||
<td style="width: 40%;">
|
||||
<select onchange="change_config(this.value, data2, '{{len}}')" name="config">
|
||||
<option id="config" value="{{len}}">New config</option>
|
||||
{% for i in configs %}
|
||||
<option id="{{configs[i]['name']}}" value="{{i}}">{{configs[i]['name']}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td style="width: 10%;">name : </td>
|
||||
<td>
|
||||
<input type="text" id="name" name="name" value = "">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 10%;">Proxy : </td>
|
||||
<td style="width: 40%;">
|
||||
<select id="proxy" name="proxy">
|
||||
<option id="" value="-1">No proxy</option>
|
||||
{% for i in proxys %}
|
||||
<option id="{{proxys[i]['name']}}" value="{{i}}">{{proxys[i]['name']}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td style="width: 10%;">Discord : </td>
|
||||
<td>
|
||||
<select id="discord" name="discord">
|
||||
<option id="no discord" value="-1">No discord (not sure about the support)</option>
|
||||
{% for i in discords %}
|
||||
<option id="{{discords[i]['name']}}" value="{{i}}">{{discords[i]['name']}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br><br>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Mail</td>
|
||||
<td>Password</td>
|
||||
<td>2FA</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" id="mail1" name="mail1" value=""></td>
|
||||
<td><input type="text" id="pwd1" name="pwd1" value=""></td>
|
||||
<td><input type="text" id="2fa1" name="2fa1" value=""></td>
|
||||
<td class="left-button"><button class="ban" name="ban" value="">ban</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" id="mail2" name="mail2" value=""></td>
|
||||
<td><input type="text" id="pwd2" name="pwd2" value=""></td>
|
||||
<td><input type="text" id="2fa2" name="2fa2" value=""></td>
|
||||
<td class="left-button"><button class="ban" name="ban" value="">ban</button></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" id="mail3" name="mail3" value=""></td>
|
||||
<td><input type="text" id="pwd3" name="pwd3" value="" ></td>
|
||||
<td><input type="text" id="2fa3" name="2fa3" value=""></td>
|
||||
<td class="left-button"><button class="ban" name="ban" value="">ban</button></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" id="mail4" name="mail4" value=""></td>
|
||||
<td><input type="text" id="pwd4" name="pwd4" value="" ></td>
|
||||
<td><input type="text" id="2fa4" name="2fa4" value=""></td>
|
||||
<td class="left-button"><button class="ban" name="ban" value="">ban</button></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" id="mail5" name="mail5" value=""></td>
|
||||
<td><input type="text" id="pwd5" name="pwd5" value=""></td>
|
||||
<td><input type="text" id="2fa5" name="2fa5" value=""></td>
|
||||
<td class="left-button"><button class="ban" name="ban" value="">ban</button></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="submit" class="confirm" name="data" id="submit" value="Create !" class="button" style="width:97%;"/>
|
||||
</td>
|
||||
<td class="left-button">
|
||||
<input type="submit" name="data" id="delete" value="delete" class="ban" style="visibility: hidden;"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,31 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block left_pannel %}{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<table>
|
||||
<tr>
|
||||
<td width="20%" height="90%">
|
||||
<div id="console"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
const consoleElement = document.getElementById('console');
|
||||
const eventSource = new EventSource('/stream');
|
||||
|
||||
eventSource.onmessage = (event) => {
|
||||
console.log("je ne comprend vraiment plus rien, meme git me casse les couilles");
|
||||
const newOutput = document.createElement('div');
|
||||
newOutput.textContent = event.data;
|
||||
consoleElement.appendChild(newOutput);
|
||||
};
|
||||
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,56 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% block left_pannel %}discord{% endblock %}
|
||||
{% block content %}
|
||||
<script>data = JSON.parse('{{data|tojson}}'); </script>
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<form method="post" action="/discord/">
|
||||
<table>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<select name="select" onchange="change_discord(this.value, data, '{{len}}')">
|
||||
<option selected id="new" value="{{ len }}">Create new Discord config</option>
|
||||
{% for i in data %}
|
||||
<option id="{{data[i]['name']}}" value="{{i}}">{{data[i]['name']}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">name</td>
|
||||
<td><input type="text" id="name" name="name" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">Send errors</td>
|
||||
<td><input type="checkbox" id="errorsT" name="errorsT" class="toogle"/><label for="errorsT">Toggle</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">Send success</td>
|
||||
<td><input type="checkbox" id="successT" name="successT" class="toogle"/><label for="successT">Toggle</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">Success link</td>
|
||||
<td><input type="text" id="successL" name="successL" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">Failure Link</td>
|
||||
<td><input type="text" id="errorsL" name="errorsL" value=""></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="comlumn-name"></td>
|
||||
<td style="width:60%;"><input type="submit" name="DISCORD" id="submit" value="Create !" class="confirm" style="width:86%;"/></td>
|
||||
<td style="padding-right: 20px;">
|
||||
<input type="submit" name="DISCORD" id="submit" value="delete" class="ban" style="width:60%;"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,23 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% block left_pannel %}login{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<form method="post" action="/login/">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="comlumn-name">password</td>
|
||||
<td><input type="password" name="password"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" name="DISCORD" value="send" class="button"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
{% else %}
|
||||
<h1>Already logged in</h1>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,44 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% block left_pannel %}logs{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<h1>Already logged in</h1>
|
||||
{% else %}
|
||||
|
||||
<select name="select" onchange="change_logs(this.value)">
|
||||
<option id="null" value="0">Choisir une config</option>
|
||||
{% for file in files %}
|
||||
<option id="{{ file[0] }}" value="{{ file[1] }}">{{ file[0] }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<br><br>
|
||||
<iframe type="text/html" src="{{url_for('static', filename='logs/1.txt')}}" width="100%" height="85%" id="embed"></iframe>
|
||||
|
||||
<script defer>
|
||||
const iframe = document.getElementsByTagName("iframe")[0];
|
||||
var script = document.createElement('script');
|
||||
|
||||
// Wait until ansi_up load
|
||||
script.onload = function () {
|
||||
// Wait until iframe load
|
||||
iframe.onload = function() {
|
||||
const subdoc = iframe.contentWindow.document;
|
||||
const subBody = subdoc.getElementsByTagName("body")[0]
|
||||
let ansiOutput = subBody;
|
||||
// Depending on the content encoding (and maybe on the browser)
|
||||
// a <pre> is added around the content of the file
|
||||
if (subBody.getElementsByTagName("pre").length > 0) {
|
||||
ansiOutput = subBody.getElementsByTagName("pre")[0];
|
||||
}
|
||||
const ansi_up = new AnsiUp();
|
||||
ansiOutput.innerHTML = ansi_up.ansi_to_html(ansiOutput.innerText);
|
||||
}
|
||||
};
|
||||
|
||||
script.src = "https://cdn.jsdelivr.net/npm/ansi_up@4.0.4/ansi_up.js";
|
||||
document.head.appendChild(script);
|
||||
</script>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,53 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% block left_pannel %}proxy{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<form method="post" action="/proxy/">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td class="comlumn-name"></td>
|
||||
<td>
|
||||
<script>data = JSON.parse('{{data|tojson}}');</script>
|
||||
<select name="select" onchange="change_proxy(this.value, data, '{{len}}')">
|
||||
<option selected id="new" value="{{ len }}">Create new proxy</option>
|
||||
{% for i in data %}
|
||||
<option id="{{data[i]['name']}}" value="{{i}}">{{data[i]['name']}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">name : </td>
|
||||
<td><input type="text" name="name" value="" id="name"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">address : </td>
|
||||
<td><input type="text" name="address" value="" id="address"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">port : </td>
|
||||
<td><input type="text" name="port" value="" id="port"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="comlumn-name"></td>
|
||||
<td style="width:60%;"><input type="submit" name="PROXY" id="submit" value="Create !" class="confirm" style="width:86%;"/></td>
|
||||
<td style="padding-right: 20px;"><input type="submit" name="PROXY" id="submit" value="delete" class="ban" style="width:60%;"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% block left_pannel %}schedule{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
|
||||
<form method="post" action="/schedule/">
|
||||
<table>
|
||||
{% for i in data %}
|
||||
<tr>
|
||||
<td>{{data[i]['name']}}</td>
|
||||
<td>
|
||||
<input type="time" id="{{i}}" name="time{{i}}" value="{{data[i]['time']}}" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" class="toogle" id="switch{{i}}" name="switch{{i}}" {{ "checked" if data[i]['enabled'] == True else "" }} />
|
||||
<label for="switch{{i}}">
|
||||
Toggle
|
||||
</label>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<input type="submit" name="data" value="Update" class="button"/>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{%endblock %}
|
|
@ -1,49 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% block left_pannel %}settings{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<form method="post" action="/settings/">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="comlumn-name">avatar url :</td>
|
||||
<td><input type="text" name="avatarlink" value="{{data['avatarlink']}}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="submit" name="settings" id="submit" value="update" class="button"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<h2>TODO</h2>
|
||||
<ul>
|
||||
<li>ban button</li>
|
||||
</ul>
|
||||
<br><br>
|
||||
<h2>Backup config files</h2>
|
||||
<ul>
|
||||
<li><a href="/download/configs.json">download account config</a></li>
|
||||
<li><a href="/download/discord.json">download discord config</a></li>
|
||||
<li><a href="/download/flask.json">download flask config</a></li>
|
||||
<li><a href="/download/proxy.json">download proxy config</a></li>
|
||||
<li><a href="/download/settings.json">download settings</a></li>
|
||||
</ul>
|
||||
|
||||
<br><br>
|
||||
<h2>Upload your files</h2>
|
||||
<form method="POST" action="/upload_file/" enctype=multipart/form-data>
|
||||
<table id="table">
|
||||
<tr><td><input type="file" id="file1" name="file1" onchange='addline(0)'></td></tr>
|
||||
<tr><td><input type="submit" name="settings" id="submit" value="send file" class="button"/></td></tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
{% endif %}
|
||||
{%endblock %}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% block left_pannel %}stats{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<iframe src="/grafana?orgId=1&kiosk" width="100%" height="100%" frameborder="0"></iframe>
|
||||
{% endif %}
|
||||
|
||||
{%endblock %}
|
|
@ -1,45 +0,0 @@
|
|||
|
||||
{% extends "base.html" %}
|
||||
{% block left_pannel %}override{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<script>data = JSON.parse('{{configs|tojson}}'); </script>
|
||||
|
||||
|
||||
<form method="post" action="/override/" height="90%">
|
||||
<select onchange="change_override(this.value, data)" name="config">
|
||||
<option id="-1" value="-1" selected>Select a config</option>
|
||||
{% for i in configs %}
|
||||
<option id="{{configs[i]['name']}}" value="{{i}}">{{configs[i]['name']}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<table height="90%" class="lines">
|
||||
<tr>
|
||||
<td width="30%">name</td>
|
||||
<td width="14%">Unban</td>
|
||||
<td width="14%">tout</td>
|
||||
<td width="14%">daily</td>
|
||||
<td width="14%">pc</td>
|
||||
<td width="14%">mobile</td>
|
||||
</tr>
|
||||
{% for i in range(0,5) %}
|
||||
<tr heigh="15%">
|
||||
<td id="compte_{{i+1}}"></td>
|
||||
<td id="{{i+1}}1" style="visibility: hidden;"><input type="checkbox" id="compte_{{i+1}}" value="{{i}}" name="unban"></td>
|
||||
<td id="{{i+1}}2" style="visibility: hidden;"><input type="checkbox" id="compte_{{i+1}}" value="{{i}}" name="tout"></td>
|
||||
<td id="{{i+1}}3" style="visibility: hidden;"><input type="checkbox" id="compte_{{i+1}}" value="{{i}}" name="daily"></td>
|
||||
<td id="{{i+1}}4" style="visibility: hidden;"><input type="checkbox" id="compte_{{i+1}}" value="{{i}}" name="pc"></td>
|
||||
<td id="{{i+1}}5" style="visibility: hidden;"><input type="checkbox" id="compte_{{i+1}}" value="{{i}}" name="mobile"></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
|
||||
<input type="submit" name="VNC" id="submit" value="Start" class="confirm" style="width:60%;"/>
|
||||
</form>
|
||||
{% endif %}
|
||||
{%endblock %}
|
|
@ -1,48 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% block left_pannel %}override{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/vnc-post.css') }}"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='node_modules/xterm/css/xterm.css') }}"/>
|
||||
<script src="{{ url_for('static', filename='node_modules/xterm/lib/xterm.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='node_modules/xterm-addon-fit/lib/xterm-addon-fit.js') }}"></script>
|
||||
<script>
|
||||
document.getElementsByClassName("content")[0].style.padding = "0 0"
|
||||
</script>
|
||||
<div class="container">
|
||||
<div id="console"></div>
|
||||
<div id="vnc-container">
|
||||
<iframe src="/novnc/vnc.html?resize=scale&path=novnc/websockify&autoconnect=true&view_only"
|
||||
width="100%" height="100%" frameborder="0">
|
||||
</iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var term = new Terminal();
|
||||
const fitAddon = new FitAddon.FitAddon();
|
||||
term.loadAddon(fitAddon);
|
||||
term.open(document.getElementById('console'));
|
||||
fitAddon.fit()
|
||||
addEventListener("transitionend", (event) => {
|
||||
fitAddon.fit()
|
||||
});
|
||||
|
||||
document.getElementById("console").style.textAlign = "left"
|
||||
const eventSource = new EventSource('/stream');
|
||||
|
||||
eventSource.onmessage = (event) => {
|
||||
term.writeln(event.data)
|
||||
};
|
||||
addEventListener("resize", (event) => {
|
||||
fitAddon.fit()
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
@ -0,0 +1,45 @@
|
|||
# MsReward
|
||||
|
||||
|
||||
A Microsoft reward automator, designed to work headless on a raspberry pi. Tested with a pi 3b+ and a pi 4 2Gb .
|
||||
Using a discord webhook or SQL to log points everydays.
|
||||
Using Selenium and geckodriver.
|
||||
|
||||
## If you're using docker (way easier)
|
||||
to use docker, run
|
||||
```
|
||||
sudo docker build .
|
||||
#copy the build id
|
||||
sudo docker run -ti --name MsRewards [build id]
|
||||
```
|
||||
Then, fill the config and start the programm everydays with
|
||||
```
|
||||
sudo docker start MsRewards
|
||||
```
|
||||
|
||||
## Other configuration
|
||||
|
||||
To use the database, I recommand MySql, Create a database with the name you want and create a table `daily`, like the one from the image :
|
||||
![B96F2F6D-7257-4F12-BFA7-0BEC3FB72993](https://user-images.githubusercontent.com/74496300/172872979-05396b6b-b682-471a-b71b-41602d816504.jpeg)
|
||||
|
||||
You have to use the default worldlist (`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.
|
||||
![image](https://user-images.githubusercontent.com/74496300/155960737-061229ca-db8c-4e66-9aef-542d9e709bb2.png)
|
||||
|
||||
## If you're **not** using docker
|
||||
|
||||
installation recommandation :
|
||||
```
|
||||
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/
|
||||
```
|
|
@ -0,0 +1,986 @@
|
|||
#!/usr/bin/python3.10
|
||||
import asyncio
|
||||
import csv
|
||||
from os import sys, system, path
|
||||
from random import choice, randint, shuffle, uniform
|
||||
from re import findall, search
|
||||
from sys import platform
|
||||
from time import sleep
|
||||
from requests import get
|
||||
from selenium import webdriver
|
||||
from selenium.common import exceptions
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.common.keys import Keys
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
from selenium.webdriver.support.ui import Select
|
||||
from rich.progress import BarColumn, Progress, TextColumn, Progress, TimeElapsedColumn, TaskProgressColumn, TimeRemainingColumn
|
||||
|
||||
from modules.db import add_to_database
|
||||
from modules.config import *
|
||||
from modules.tools import *
|
||||
from modules.error import *
|
||||
import modules.progress
|
||||
global driver
|
||||
|
||||
|
||||
def printf(x):
|
||||
printf2(x, _mail)
|
||||
|
||||
|
||||
def WaitUntilVisible(by, id, to = 20, browser = driver):
|
||||
try :
|
||||
WebDriverWait(browser, to).until(EC.visibility_of_element_located((by,id)), "element not found")
|
||||
except TimeoutException as e:
|
||||
print(f"element not found after {to}s")
|
||||
|
||||
|
||||
def claim_amazon():
|
||||
try :
|
||||
driver.get("https://rewards.microsoft.com/redeem/000803000031")
|
||||
try :
|
||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'ÉCHANGER UNE RÉCOMPENSE')]").click()
|
||||
except :
|
||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'REDEEM REWARD')]").click()
|
||||
sleep(5)
|
||||
try :
|
||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'CONFIRMER LA RÉCOMPENSE')]").click()
|
||||
except :
|
||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'CONFIRM REWARD')]").click()
|
||||
|
||||
sleep(5)
|
||||
|
||||
if ("/rewards/redeem/orderhistory" in driver.page_source) :
|
||||
driver.get("https://rewards.microsoft.com/redeem/orderhistory")
|
||||
try :
|
||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'Détails de la commande')]").click()
|
||||
except :
|
||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'Get code')]").click()
|
||||
sleep(5)
|
||||
code = driver.find_element(By.CLASS_NAME, "tango-credential-value").get_attribute('innerHTML')
|
||||
lien = driver.find_elements(By.CLASS_NAME, "tango-credential-key")[1].get_attribute('innerHTML')
|
||||
lien = search('\"([^\"]+)\"',lien)[1]
|
||||
driver.get(lien)
|
||||
sleep(10)
|
||||
box = driver.find_element(By.ID, "input-45")
|
||||
box.click()
|
||||
box.send_keys(code)
|
||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'Déverrouillez votre récompense')]").click()
|
||||
sleep(5)
|
||||
#amazon = search("> ([^ ]+) <", fcode)[1]
|
||||
fcode = driver.find_element(By.XPATH, "/html/body/div[1]/div[1]/main/div/div/div/div/div[1]/div/div[1]/div[2]/div[2]/div/div/div/div/div/div[2]/span").get_attribute("innerHTML")
|
||||
if fcode :
|
||||
webhookFailure.send(_mail)
|
||||
webhookFailure.send(fcode)
|
||||
return(1)
|
||||
else :
|
||||
LogError("impossible de localiser le code ", driver, _mail)
|
||||
return(1)
|
||||
|
||||
else :
|
||||
LogError("la recuperation ne peux pas être automatique", driver, _mail)
|
||||
return(0)
|
||||
except Exception as e :
|
||||
LogError(f'problème dans la recuperation : {str(e)}', driver, _mail)
|
||||
|
||||
|
||||
def setup_proxy(ip, port, socks=False) :
|
||||
PROXY = f"{ip}:{port}"
|
||||
if socks :
|
||||
options.set_preference('network.proxy.type', 1)
|
||||
options.set_preference('network.proxy.socks', ip)
|
||||
options.set_preference('network.proxy.socks_port', int(port))
|
||||
options.set_preference("browser.link.open_newwindow", 3)
|
||||
else :
|
||||
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
|
||||
"httpProxy": PROXY,
|
||||
"sslProxy": PROXY,
|
||||
"proxyType": "MANUAL",
|
||||
}
|
||||
|
||||
|
||||
def FirefoxDriver(mobile=False, Headless=Headless):
|
||||
if proxy_enabled :
|
||||
setup_proxy(proxy_address,proxy_port)
|
||||
PC_USER_AGENT = (
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
|
||||
"AppleWebKit/537.36 (KHTML, like Gecko)"
|
||||
"Chrome/104.0.5112.102 Safari/537.36 Edg/104.0.1293.70"
|
||||
)
|
||||
MOBILE_USER_AGENT = (
|
||||
"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X)"
|
||||
"AppleWebKit/605.1.15 (KHTML, like Gecko)"
|
||||
"CriOS/103.0.5060.63 Mobile/15E148 Safari/604.1"
|
||||
)
|
||||
|
||||
options = Options()
|
||||
options.set_preference("browser.link.open_newwindow", 3)
|
||||
if FAST :
|
||||
options.set_preference("permissions.default.image", 2) #disable image loading. May add this without the fast option soon
|
||||
if Headless:
|
||||
options.add_argument("-headless")
|
||||
if mobile :
|
||||
options.set_preference("general.useragent.override", MOBILE_USER_AGENT)
|
||||
else :
|
||||
options.set_preference("general.useragent.override", PC_USER_AGENT)
|
||||
driver = webdriver.Firefox(options=options)
|
||||
driver.set_window_size(1900 + hash(_mail)%20 , 1070 + hash(_password + "salt")%10)
|
||||
return driver
|
||||
|
||||
|
||||
def Close(fenetre, SwitchTo=0):
|
||||
driver.switch_to.window(fenetre)
|
||||
driver.close()
|
||||
driver.switch_to.window(driver.window_handles[SwitchTo])
|
||||
|
||||
|
||||
#Deal with RGPD popup as well as some random popup like 'are you satisfied' one
|
||||
def RGPD():
|
||||
for i in ["bnp_btn_accept", "bnp_hfly_cta2", "bnp_hfly_close"] :
|
||||
try:
|
||||
driver.find_element(By.ID, i).click()
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
"""
|
||||
PlayQuiz[N]([int : override]) make the quizz with N choice each time. They usually have between 4 and 10 questions.
|
||||
override is the number of question, by default, it's the number of question in this specific quizz. Can be usefull in some case, where the programm crashes before finishing the quizz
|
||||
"""
|
||||
def PlayQuiz2(override=10):
|
||||
printf("début de PlayQuiz2")
|
||||
for j in range(override):
|
||||
try:
|
||||
RGPD()
|
||||
CustomSleep(uniform(3, 5))
|
||||
txt = driver.page_source
|
||||
secret = search('IG:"([^"]+)"', txt)[1] # variable dans la page, pour calculer le offset
|
||||
reponse1 = search('data-option="([^"]+)"', txt)[1]
|
||||
offset = int(secret[-2:], 16) # la conversion ec decimal des deux dernier caracteres de IG
|
||||
reponse = search('correctAnswer":"([0-9]+)', txt)[1]
|
||||
somme = 0
|
||||
|
||||
for i in reponse1:
|
||||
somme += ord(i)
|
||||
|
||||
if somme + offset == int(reponse):
|
||||
elem = driver.find_element(By.ID, "rqAnswerOption0")
|
||||
elem.click()
|
||||
progressBar(j, 10, name="quiz 2")
|
||||
|
||||
else:
|
||||
elem = driver.find_element(By.ID, "rqAnswerOption1")
|
||||
elem.click()
|
||||
progressBar(j, 10, name="quiz 2")
|
||||
|
||||
except exceptions.ElementNotInteractableException as e:
|
||||
driver.execute_script("arguments[0].click();", elem)
|
||||
|
||||
except Exception as e:
|
||||
LogError("PlayQuiz2" + str(e), driver, _mail)
|
||||
break
|
||||
printf("PlayQuiz2 finis")
|
||||
|
||||
|
||||
def PlayQuiz8(task = None):
|
||||
override = len(findall("<span id=\"rqQuestionState.\" class=\"emptyCircle\"></span>", driver.page_source))+1
|
||||
printf(f"PlayQuiz8 : start, override : {override}")
|
||||
try:
|
||||
c = 0
|
||||
RGPD()
|
||||
for i in range(override):
|
||||
CustomSleep(uniform(3, 5))
|
||||
AnswerOptions = [ (driver.find_element(By.ID, f"rqAnswerOption{i-1}"),f'rqAnswerOption{i-1}') for i in range(1,9)]
|
||||
isCorrect = [x[1] for x in AnswerOptions if 'iscorrectoption="True" ' in x[0].get_attribute("outerHTML") ]
|
||||
shuffle(isCorrect)
|
||||
|
||||
for i in isCorrect:
|
||||
WaitUntilVisible(By.ID, i, to = 20, browser=driver)
|
||||
c += 1
|
||||
progressBar(c, 16, name="Quiz 8 ")
|
||||
try:
|
||||
elem = driver.find_element(By.ID, i)
|
||||
elem.click()
|
||||
if not task is None:
|
||||
AdvanceTask(task, 1/override / len(isCorrect) * 100)
|
||||
except exceptions.NoSuchElementException :
|
||||
driver.refresh()
|
||||
CustomSleep(10)
|
||||
elem = driver.find_element(By.ID, i)
|
||||
elem.click()
|
||||
except ElementClickInterceptedException :
|
||||
RGPD()
|
||||
isCorrect.append(i)
|
||||
|
||||
|
||||
except Exception as e:
|
||||
LogError(f"PlayQuiz8 - 4 - {e} \n ListOfGood : {str(isCorrect)}", driver, _mail)
|
||||
|
||||
printf("PlayQuiz8 : fin ")
|
||||
|
||||
|
||||
def PlayQuiz4(override=None):
|
||||
printf("PlayQuiz4 : start")
|
||||
if not override:
|
||||
try: # permet de gerer les truc de fidélité, qui sont plus long
|
||||
override = int(findall('rqQuestionState([\d]{1,2})"', driver.page_source)[-1])
|
||||
printf(f"Override : {override}")
|
||||
except:
|
||||
override = 3
|
||||
|
||||
try:
|
||||
for i in range(override):
|
||||
CustomSleep(uniform(3, 5))
|
||||
txt = driver.page_source
|
||||
RGPD()
|
||||
reponse = search('correctAnswer":"([^"]+)', txt)[1] # je suis pas sur qu'il y ait un espace
|
||||
reponse = reponse.replace("\\u0027", "'") # il faut cancel l'unicode avec un double \ (on replacer les caracteres en unicode en caracteres utf-8)
|
||||
printf(f"validation de la reponse ")
|
||||
printf(f"validation de la reponse {i+1}/{override} {reponse}")
|
||||
try:
|
||||
elem = driver.find_element(
|
||||
By.CSS_SELECTOR, f'[data-option="{reponse}"]'
|
||||
)
|
||||
elem.click()
|
||||
except exceptions.ElementNotInteractableException:
|
||||
driver.execute_script("arguments[0].click();", elem)
|
||||
|
||||
except Exception as e:
|
||||
LogError(f"PlayQuiz4 {str(e)}", driver, _mail)
|
||||
raise ValueError(e)
|
||||
printf("PlayQuiz4 : end")
|
||||
|
||||
|
||||
"""
|
||||
PlayPoll() reply a random thing to poll, on of daily activities
|
||||
"""
|
||||
def PlayPoll():
|
||||
printf("PlayPoll : start")
|
||||
try:
|
||||
try:
|
||||
elem = driver.find_element(By.ID, f"btoption{choice([0,1])}")
|
||||
elem.click()
|
||||
except exceptions.ElementNotInteractableException as e:
|
||||
driver.execute_script("arguments[0].click();", elem)
|
||||
CustomSleep(uniform(2, 2.5))
|
||||
except Exception as e:
|
||||
LogError("PlayPoll" + str(e), driver, _mail)
|
||||
raise ValueError(e)
|
||||
printf("PlayPoll : end")
|
||||
|
||||
|
||||
def AllCard(): # fonction qui clique sur les cartes
|
||||
def reset(Partie2=False): # retourne sur la page de depart apres avoir finis
|
||||
if len(driver.window_handles) == 1:
|
||||
driver.get("https://www.bing.com/rewardsapp/flyout")
|
||||
if Partie2:
|
||||
driver.find_element(
|
||||
By.XPATH, "/html/body/div/div/div[3]/div[2]/div[2]/div[2]/div[1]"
|
||||
).click()
|
||||
else:
|
||||
driver.switch_to.window(driver.window_handles[1])
|
||||
printf(f"fermeture : {driver.current_url}")
|
||||
driver.close()
|
||||
driver.switch_to.window(driver.window_handles[0])
|
||||
reset(Partie2)
|
||||
|
||||
def dailyCards():
|
||||
try:
|
||||
StartTask(task["daily"][f"all"])
|
||||
for i in range(3):
|
||||
StartTask(task["daily"][f"carte{i}"])
|
||||
CustomSleep(uniform(3, 5))
|
||||
try:
|
||||
titre = "erreur"
|
||||
driver.find_element(
|
||||
By.XPATH,f"/html/body/div/div/div[3]/div[2]/div[1]/div[2]/div/div[{i+1}]/a/div/div[2]",
|
||||
).click()
|
||||
sleep(1)
|
||||
titre = driver.title
|
||||
TryPlay(titre, task=task["daily"][f"carte{i}"])
|
||||
AdvanceTask(task["daily"][f"carte{i}"], 100)
|
||||
ChangeColor(task["daily"][f"carte{i}"], "green")
|
||||
sleep(1)
|
||||
reset()
|
||||
printf(f"DailyCard {titre} ok ")
|
||||
except Exception as e:
|
||||
printf(f"Allcard card {titre} error ({e})")
|
||||
except Exception as e:
|
||||
LogError(f"Dailycards {e}", driver, _mail)
|
||||
|
||||
try:
|
||||
dailyCards()
|
||||
except Exception as e:
|
||||
printf(f"erreur dans les quetes de la semaine {e}")
|
||||
|
||||
def weekly_cards():
|
||||
try:
|
||||
driver.find_element(
|
||||
By.XPATH, "/html/body/div/div/div[3]/div[2]/div[2]/div[2]/div[1]"
|
||||
).click() # declenche la premiere partie ?
|
||||
except:
|
||||
reset()
|
||||
try:
|
||||
driver.find_element(
|
||||
By.XPATH, "/html/body/div/div/div[3]/div[2]/div[2]/div[2]/div[1]"
|
||||
).click() # declenche la deuxieme partie ?
|
||||
except:
|
||||
pass
|
||||
|
||||
for i in range(20):
|
||||
printf("début de l'une des cartes")
|
||||
driver.find_element(
|
||||
By.XPATH,
|
||||
"/html/body/div/div/div[3]/div[2]/div[2]/div[3]/div/div[1]/a/div/div[2]",
|
||||
).click()
|
||||
printf("carte cliquée")
|
||||
driver.switch_to.window(driver.window_handles[len(driver.window_handles) - 1])
|
||||
sleep(1)
|
||||
titre = driver.title
|
||||
print(f"carte {titre} en cours")
|
||||
TryPlay(titre)
|
||||
reset(True)
|
||||
sleep(1)
|
||||
try:
|
||||
link = findall('href="([^<]+)" title=""', driver.page_source)[
|
||||
3
|
||||
] # verifie si on a toujours des cartes
|
||||
except:
|
||||
break
|
||||
for i in range(2): # don't seem useful for fixing error
|
||||
try :
|
||||
weekly_cards()
|
||||
break
|
||||
except Exception as e:
|
||||
LogError(f"weekly_cards, try n°{i+1} \n {e}", driver, _mail)
|
||||
if i == 0 :
|
||||
driver.refresh()
|
||||
else :
|
||||
CustomSleep(1800)
|
||||
driver.refresh()
|
||||
|
||||
|
||||
"""
|
||||
login() tries to login to your micrososft account.
|
||||
it uses global variable _mail and _password to login
|
||||
"""
|
||||
def login():
|
||||
global driver
|
||||
def sub_login():
|
||||
printf("sublogin : start")
|
||||
driver.get("https://www.bing.com/rewardsapp/flyout")
|
||||
for i in [f'[title="Rejoindre"]', f'[title="Join now"]', f'[title="Rejoindre maintenant"]'] :
|
||||
try:
|
||||
driver.find_element(By.CSS_SELECTOR, i).click() # depend of the language of the page
|
||||
break
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
WaitUntilVisible(By.ID, "i0116", browser = driver)
|
||||
mail = driver.find_element(By.ID, "i0116")
|
||||
send_keys_wait(mail, _mail)
|
||||
mail.send_keys(Keys.ENTER)
|
||||
WaitUntilVisible(By.ID, "i0118", browser = driver)
|
||||
pwd = driver.find_element(By.ID, "i0118")
|
||||
send_keys_wait(pwd, _password)
|
||||
pwd.send_keys(Keys.ENTER)
|
||||
CustomSleep(5)
|
||||
|
||||
if ('Abuse' in driver.current_url) :
|
||||
LogError("account suspended", driver, _mail)
|
||||
raise Banned()
|
||||
|
||||
|
||||
for i in ["KmsiCheckboxField","iLooksGood", "idSIButton9", "iCancel"]:
|
||||
try:
|
||||
driver.find_element(By.ID, i).click()
|
||||
except Exception as e:
|
||||
pass
|
||||
try :
|
||||
elm = driver.find_element(By.TAG_NAME, "body")
|
||||
elm.send_keys(Keys.ENTER)
|
||||
except :
|
||||
pass
|
||||
printf("login completed")
|
||||
RGPD()
|
||||
CustomSleep(uniform(3,5))
|
||||
driver.get("https://www.bing.com/rewardsapp/flyout")
|
||||
CustomSleep(uniform(3,5))
|
||||
|
||||
for i in range(3) :
|
||||
try :
|
||||
sub_login()
|
||||
return (driver.current_window_handle)
|
||||
except Banned:
|
||||
raise Banned()
|
||||
except Exception as e:
|
||||
LogError("login - 3 - " + str(e), driver, _mail)
|
||||
driver.close()
|
||||
CustomSleep(1200)
|
||||
driver = FirefoxDriver()
|
||||
return("STOP")
|
||||
|
||||
|
||||
def BingPcSearch(override=randint(35, 40)):
|
||||
StartTask(task["PC"])
|
||||
driver.get(f"https://www.bing.com/search?q=test") # {choice(Liste_de_mot)}')
|
||||
CustomSleep(uniform(1, 2))
|
||||
RGPD()
|
||||
send_keys_wait(
|
||||
driver.find_element(By.ID, "sb_form_q"),
|
||||
Keys.BACKSPACE
|
||||
+ Keys.BACKSPACE
|
||||
+ Keys.BACKSPACE
|
||||
+ Keys.BACKSPACE
|
||||
+ Keys.BACKSPACE
|
||||
+ Keys.BACKSPACE,
|
||||
)
|
||||
|
||||
for i in range(override):
|
||||
mot = choice(Liste_de_mot)
|
||||
try:
|
||||
send_keys_wait(driver.find_element(By.ID, "sb_form_q"), mot)
|
||||
driver.find_element(By.ID, "sb_form_q").send_keys(Keys.ENTER)
|
||||
except Exception as e :
|
||||
printf(e)
|
||||
sleep(10)
|
||||
driver.get('https://www.bing.com/search?q=pls')
|
||||
sleep(3)
|
||||
send_keys_wait(driver.find_element(By.ID, "sb_form_q"), mot)
|
||||
driver.find_element(By.ID, "sb_form_q").send_keys(Keys.ENTER)
|
||||
|
||||
AdvanceTask(task["PC"], 1/override * 100 )
|
||||
CustomSleep(uniform(5, 20))
|
||||
|
||||
try:
|
||||
driver.find_element(By.ID, "sb_form_q").clear()
|
||||
except Exception as e:
|
||||
printf(e)
|
||||
try:
|
||||
driver.get('https://www.bing.com/search?q=pls')
|
||||
driver.find_element(By.ID, "sb_form_q").clear()
|
||||
except Exception as e:
|
||||
LogError(f"BingPcSearch - clear la barre de recherche - {e}", driver, _mail)
|
||||
|
||||
ChangeColor(task["PC"], "green")
|
||||
|
||||
|
||||
def unban():
|
||||
driver.find_element(By.ID, "StartAction").click()
|
||||
CustomSleep(10)
|
||||
txt = driver.page_source
|
||||
uuid0 = findall('wlspispHIPCountrySelect([a-z0-9]+)', txt)[0]
|
||||
uuid1 = findall('wlspispHIPPhoneInput([a-z0-9]+)', txt)[0]
|
||||
uuid2 = findall('wlspispHipSendCode([a-z0-9]+)', txt)[0]
|
||||
uuid3 = findall('wlspispSolutionElement([a-z0-9]+)', txt)[0]
|
||||
sel = Select(driver.find_element(By.ID, "wlspispHIPCountrySelect" + uuid0))
|
||||
CC = input("enter Contry code (FR, ...) ")
|
||||
sel.select_by_value(CC)
|
||||
WaitUntilVisible(By.ID, "wlspispHIPPhoneInput" + uuid1, browser=driver)
|
||||
phone = input("entrez le numero de téléphone : +33")
|
||||
phone_box = driver.find_element(By.ID, "wlspispHIPPhoneInput" + uuid1)
|
||||
phone_box.send_keys(phone)
|
||||
WaitUntilVisible(By.ID, "wlspispHipSendCode" + uuid2, browser=driver)
|
||||
send_link = driver.find_element(By.ID, "wlspispHipSendCode" + uuid2)
|
||||
send_link.click()
|
||||
WaitUntilVisible(By.ID, "wlspispSolutionElement" + uuid3, browser=driver)
|
||||
LogError("test", driver,"phone test")
|
||||
answer_box = driver.find_element(By.ID, "wlspispSolutionElement" + uuid3)
|
||||
answer = input("entrez le contenu du msg : ")
|
||||
answer_box.send_keys(answer)
|
||||
send_box = driver.find_element(By.ID, "ProofAction")
|
||||
send_box.click()
|
||||
WaitUntilVisible(By.ID, "FinishAction", browser=driver)
|
||||
continue_box = driver.find_element(By.ID, "FinishAction")
|
||||
continue_box.click()
|
||||
|
||||
|
||||
def TryPlay(nom="inconnu", task = None):
|
||||
RGPD()
|
||||
printf("TryPlay en cours")
|
||||
|
||||
def play(number):
|
||||
if number == 8 or number == 9:
|
||||
try:
|
||||
printf(f"\033[96m Quiz 8 détecté sur la page {nom} \033[0m")
|
||||
PlayQuiz8(task=task)
|
||||
printf(f"\033[92m Quiz 8 reussit sur {nom} \033[0m")
|
||||
except Exception as e:
|
||||
printf(f"echec de PlayQuiz 8. Aborted {e} \033[0m")
|
||||
|
||||
elif number == 5 or number == 4:
|
||||
try:
|
||||
printf(f"\033[96m Quiz 4 détecté sur la page {nom} \033[0m")
|
||||
PlayQuiz4()
|
||||
printf(f"\033[92m Quiz 4 reussit sur {nom} \033[0m")
|
||||
except Exception as e:
|
||||
printf(f"echec de PlayQuiz 4. Aborted {e} \033[0m")
|
||||
|
||||
elif number == 3 or number == 2:
|
||||
try:
|
||||
printf(f"\033[96m Quiz 2 détecté sur la page {nom}\033[0m")
|
||||
PlayQuiz2()
|
||||
printf(f"\033[92m Quiz 2 reussit sur la page {nom}\033[0m")
|
||||
except Exception as e:
|
||||
printf(f"echec de PlayQuiz 2. Aborted {e}")
|
||||
else:
|
||||
LogError("probleme dans la carte : il y a un bouton play et aucun quiz detecté", driver, _mail)
|
||||
|
||||
try:
|
||||
driver.find_element(By.ID, "rqStartQuiz").click() # start the quiz
|
||||
number = driver.page_source.count("rqAnswerOption")
|
||||
play(number)
|
||||
|
||||
except Exception as e:
|
||||
# printf(e) normal error here
|
||||
if "bt_PollRadio" in driver.page_source:
|
||||
try:
|
||||
printf("Poll détected")
|
||||
RGPD()
|
||||
PlayPoll()
|
||||
printf("Poll reussit ")
|
||||
except Exception as e:
|
||||
printf(f"TryPlay - 1 - Poll aborted {e}")
|
||||
|
||||
elif "rqQuestionState" in driver.page_source:
|
||||
try:
|
||||
number = driver.page_source.count("rqAnswerOption")
|
||||
printf(f"recovery détecté. quiz : {number}")
|
||||
play(number-1, override=restant + 1)
|
||||
except Exception as e:
|
||||
printf("TryPlay - 2 - " + e)
|
||||
|
||||
elif search("([0-9]) de ([0-9]) finalisée", driver.page_source):
|
||||
print("fidélité")
|
||||
RGPD()
|
||||
Fidelite()
|
||||
|
||||
else:
|
||||
printf(f"rien à faire sur la page {nom}")
|
||||
RGPD()
|
||||
CustomSleep(uniform(3, 5))
|
||||
|
||||
|
||||
def LogPoint(account="unknown"): # log des points sur discord
|
||||
def get_points():
|
||||
driver.get("https://www.bing.com/rewardsapp/flyout")
|
||||
if not LINUX_HOST:
|
||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||
else:
|
||||
asyncio.set_event_loop(asyncio.new_event_loop())
|
||||
|
||||
regex1 = '<a href="https://rewards\.bing\.com/" title="((.{1,3}),(.{1,3})) points" target="_blank"'
|
||||
try:
|
||||
point = search(regex1, driver.page_source)[1].replace(",", "")
|
||||
|
||||
except Exception as e:
|
||||
elem = driver.find_element(By.CSS_SELECTOR, '[title="Microsoft Rewards"]')
|
||||
elem.click()
|
||||
CustomSleep(5)
|
||||
driver.switch_to.window(driver.window_handles[len(driver.window_handles) - 1])
|
||||
CustomSleep(uniform(5,7))
|
||||
|
||||
point = search('availablePoints":([\d]+)', driver.page_source)[1]
|
||||
return(point)
|
||||
for i in range (3):
|
||||
try :
|
||||
points = get_points()
|
||||
break
|
||||
except Exception as e:
|
||||
CustomSleep(300)
|
||||
printf(f"LogPoints : {e}")
|
||||
points = None
|
||||
|
||||
if not points :
|
||||
LogError(f"impossible d'avoir les points : {e}", driver, _mail)
|
||||
CustomSleep(uniform(3, 20))
|
||||
|
||||
account = account.split("@")[0]
|
||||
|
||||
if DISCORD_ENABLED_SUCCESS:
|
||||
|
||||
if DISCORD_EMBED:
|
||||
embed = discord.Embed(
|
||||
title=f"{account} actuellement à {str(points)} points", colour=Colour.green()
|
||||
)
|
||||
embed.set_footer(text=account)
|
||||
webhookSuccess.send(embed=embed)
|
||||
else:
|
||||
webhookSuccess.send(f"{account} actuellement à {str(points)} points")
|
||||
|
||||
if CLAIM_AMAZON and int(points) >= 7500:
|
||||
if (claim_amazon() == 1) :
|
||||
points = str( int(points) - 7500)
|
||||
|
||||
if sql_enabled :
|
||||
add_to_database(account, points, sql_host, sql_usr, sql_pwd, sql_database)
|
||||
|
||||
|
||||
def Fidelite():
|
||||
try:
|
||||
while 1: #close all tabs
|
||||
try:
|
||||
Close(1)
|
||||
except:
|
||||
break
|
||||
try :
|
||||
result = get(FidelityLink) #get the url of fidelity page
|
||||
except Exception as e :
|
||||
printf(e)
|
||||
result = False
|
||||
|
||||
if result :
|
||||
lien = result.content.decode("UTF-8")
|
||||
printf(lien)
|
||||
|
||||
if (lien.split(":")[0] == "https") or (lien.split(":")[0] == "http") :
|
||||
|
||||
driver.get(lien)
|
||||
|
||||
WaitUntilVisible(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"]') # pull-left spacer-48-bottom punchcard-row? USELESS ?
|
||||
|
||||
nb = search("([0-9]) of ([0-9]) completed", driver.page_source)
|
||||
if not nb:
|
||||
nb = search("([0-9]) de ([0-9]) finalisé", driver.page_source)
|
||||
for i in range(int(nb[2]) - int(nb[1])):
|
||||
driver.refresh()
|
||||
CustomSleep(2)
|
||||
choix = driver.find_element(By.CLASS_NAME, "spacer-48-bottom")
|
||||
try :
|
||||
ButtonText = search('<span class="pull-left margin-right-15">([^<^>]+)</span>',choix.get_attribute("innerHTML"))[1]
|
||||
bouton = driver.find_element(By.XPATH, f'//span[text()="{ButtonText}"]')
|
||||
bouton.click()
|
||||
except Exception as e1 :
|
||||
try :
|
||||
t = driver.find_element(By.XPATH,'/html/body/div[1]/div[2]/main/div[2]/div[2]/div[7]/div[3]/div[1]')
|
||||
t.click()
|
||||
except Exception as e2 :
|
||||
LogError(f"fidélité - double erreur - e1 : {e1} - e2 {e2}", driver, _mail)
|
||||
break
|
||||
CustomSleep(uniform(3, 5))
|
||||
driver.switch_to.window(driver.window_handles[1])
|
||||
TryPlay(driver.title)
|
||||
driver.get(lien) # USELESS ?
|
||||
CustomSleep(uniform(3, 5))
|
||||
try:
|
||||
Close(driver.window_handles[1])
|
||||
except Exception as e:
|
||||
printf(e)
|
||||
printf("fidelité - done")
|
||||
else :
|
||||
printf("lien invalide")
|
||||
except Exception as e:
|
||||
LogError("Fidélité" + str(e), driver, _mail)
|
||||
|
||||
|
||||
def Mlogin(echec):
|
||||
try:
|
||||
MobileDriver.get("https://www.bing.com/search?q=test+speed")
|
||||
MRGPD()
|
||||
printf("start of Mobile login")
|
||||
MobileDriver.find_element(By.ID, "mHamburger").click()
|
||||
WaitUntilVisible(By.ID, "hb_s", browser=MobileDriver)
|
||||
MobileDriver.find_element(By.ID, "hb_s").click()
|
||||
WaitUntilVisible(By.ID, "i0116", browser=MobileDriver)
|
||||
mail = MobileDriver.find_element(By.ID, "i0116")
|
||||
send_keys_wait(mail, _mail)
|
||||
mail.send_keys(Keys.ENTER)
|
||||
WaitUntilVisible(By.ID, "i0118", browser=MobileDriver)
|
||||
pwd = MobileDriver.find_element(By.ID, "i0118")
|
||||
send_keys_wait(pwd, _password)
|
||||
pwd.send_keys(Keys.ENTER)
|
||||
CustomSleep(uniform(1, 2))
|
||||
for i in ["KmsiCheckboxField", "iLooksGood", "idSIButton9"]:
|
||||
try:
|
||||
MobileDriver.find_element(By.ID,i ).click()
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
printf("end of Mobile login")
|
||||
|
||||
except Exception as e:
|
||||
echec += 1
|
||||
if echec <= 3:
|
||||
printf(f"echec du login sur la version mobile. on reesaye ({echec}/3), {e}")
|
||||
CustomSleep(uniform(5, 10))
|
||||
Mlogin(echec)
|
||||
else:
|
||||
LogError(
|
||||
f"login impossible 3 fois de suite. {e}", MobileDriver, _mail
|
||||
)
|
||||
MobileDriver.quit()
|
||||
return True
|
||||
|
||||
|
||||
def MRGPD():
|
||||
try:
|
||||
MobileDriver.find_element(By.ID, "bnp_btn_accept").click()
|
||||
except Exception as e:
|
||||
pass
|
||||
try:
|
||||
MobileDriver.find_element(By.ID, "bnp_hfly_cta2").click()
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
|
||||
def Alerte():
|
||||
try:
|
||||
alert = MobileDriver.switch_to.alert
|
||||
alert.dismiss()
|
||||
except exceptions.NoAlertPresentException as e:
|
||||
pass
|
||||
except Exception as e:
|
||||
LogError(f"mobile.py -> Alerte : {e}", MobileDriver, _mail)
|
||||
|
||||
|
||||
def BingMobileSearch(override=randint(22, 25)):
|
||||
global MobileDriver
|
||||
MobileDriver = "unable to start"
|
||||
try:
|
||||
try:
|
||||
MobileDriver = FirefoxDriver(mobile=True)
|
||||
MobileDriver.implicitly_wait(15)
|
||||
except Exception as e:
|
||||
LogError("BingMobileSearch - 1 - echec de la creation du driver mobile", MobileDriver, _mail)
|
||||
ChangeColor(task["Mobile"], "red")
|
||||
echec = 0
|
||||
|
||||
if not Mlogin(echec):
|
||||
StartTask(task["Mobile"])
|
||||
CustomSleep(uniform(1, 2))
|
||||
MRGPD()
|
||||
CustomSleep(uniform(1, 1.5))
|
||||
|
||||
for i in range(override): # 20
|
||||
try :
|
||||
mot = choice(Liste_de_mot)
|
||||
send_keys_wait(MobileDriver.find_element(By.ID, "sb_form_q"), mot)
|
||||
MobileDriver.find_element(By.ID, "sb_form_q").send_keys(Keys.ENTER)
|
||||
AdvanceTask(task["Mobile"], 1/override * 100)
|
||||
#printf(MobileDriver.current_url)
|
||||
CustomSleep(uniform(5, 20))
|
||||
Alerte() # verifie si il y a des alertes (demande de positions ....)
|
||||
MobileDriver.find_element(By.ID, "sb_form_q").clear()
|
||||
except :
|
||||
driver.refresh()
|
||||
CustomSleep(30)
|
||||
i -= 1
|
||||
MobileDriver.quit()
|
||||
ChangeColor(task["Mobile"], "green")
|
||||
|
||||
except Exception as e:
|
||||
LogError("BingMobileSearch - 4 - " + str(e), MobileDriver, _mail)
|
||||
MobileDriver.quit()
|
||||
|
||||
|
||||
def DailyRoutine(custom = False):
|
||||
|
||||
ShowDefaultTask()
|
||||
try :
|
||||
if not custom: # custom already login
|
||||
login()
|
||||
except Banned :
|
||||
LogError("THIS ACCOUND IS BANNED. FIX THIS ISSUE WITH -U", driver, _mail)
|
||||
return()
|
||||
|
||||
try:
|
||||
AllCard()
|
||||
except Exception as e:
|
||||
LogError(f"DailyRoutine - AllCard - \n{e}", driver, _mail)
|
||||
|
||||
try:
|
||||
BingPcSearch()
|
||||
except Exception as e:
|
||||
LogError(f"DailyRoutine - BingPcSearch - \n{e}", driver, _mail)
|
||||
|
||||
try:
|
||||
BingMobileSearch()
|
||||
except Exception as e:
|
||||
LogError(f"DailyRoutine - BingMobileSearch - \n{e}", driver, _mail)
|
||||
|
||||
try:
|
||||
Fidelite()
|
||||
except Exception as e:
|
||||
LogError(f"DailyRoutine - Fidelité - \n{e}", driver, _mail)
|
||||
|
||||
try:
|
||||
LogPoint(_mail)
|
||||
except Exception as e:
|
||||
LogError(f"DailyRoutine - LogPoint - \n{e}", driver, _mail)
|
||||
|
||||
|
||||
def close():
|
||||
driver.quit()
|
||||
quit()
|
||||
|
||||
|
||||
def dev():
|
||||
pass
|
||||
|
||||
|
||||
def CustomStart(Credentials):
|
||||
global START_TIME
|
||||
if not LINUX_HOST :
|
||||
raise NameError('You need to be on linux to do that, due to the utilisation of a module named enquieries, sorry.')
|
||||
global driver, _mail, _password, p, task
|
||||
|
||||
system("clear") # clear from previous command to allow a clean choice
|
||||
actions = ["tout", "daily", "pc", "mobile", "LogPoint","Fidelite", "dev"]
|
||||
Actions = enquiries.choose("quels Actions ?", actions, multi=True)
|
||||
liste = SelectAccount()
|
||||
START_TIME = time() # Reset timer to the start of the actions
|
||||
with Progress(
|
||||
TextColumn("[progress.description]{task.description}"),
|
||||
BarColumn(),
|
||||
TaskProgressColumn(),
|
||||
TimeRemainingColumn(),
|
||||
TimeElapsedColumn(),
|
||||
) as p:
|
||||
task = modules.progress.dico(p)
|
||||
for _mail, _password in liste:
|
||||
|
||||
driver = FirefoxDriver()
|
||||
driver.implicitly_wait(10)
|
||||
|
||||
if login() != "STOP":
|
||||
if "tout" in Actions:
|
||||
DailyRoutine(True)
|
||||
|
||||
if "daily" in Actions:
|
||||
try:
|
||||
AllCard()
|
||||
except Exception as e:
|
||||
LogError(f"AllCards - {e} -- override", driver, _mail)
|
||||
|
||||
if "pc" in Actions:
|
||||
try:
|
||||
ShowTask(task["PC"])
|
||||
BingPcSearch()
|
||||
except Exception as e:
|
||||
LogError(f"il y a eu une erreur dans BingPcSearch, {e} -- override", driver, _mail)
|
||||
|
||||
if "mobile" in Actions:
|
||||
try:
|
||||
ShowTask(task["Mobile"])
|
||||
BingMobileSearch()
|
||||
except Exception as e:
|
||||
LogError(f"BingMobileSearch - {e} -- override", driver, _mail)
|
||||
|
||||
if "Fidelite" in Actions:
|
||||
try :
|
||||
Fidelite()
|
||||
except Exception as e :
|
||||
LogError(f"Fidelite - {e} -- override", driver, _mail)
|
||||
|
||||
if "dev" in Actions:
|
||||
try:
|
||||
dev()
|
||||
except Exception as e:
|
||||
printf(e)
|
||||
break
|
||||
|
||||
if not "tout" in Actions:
|
||||
try:
|
||||
LogPoint(_mail)
|
||||
except Exception as e:
|
||||
print("CustomStart " + str(e))
|
||||
driver.close()
|
||||
|
||||
|
||||
def SelectAccount(multiple = True):
|
||||
system("clear") # clear from previous command to allow a clean choice
|
||||
emails = [x[0] for x in Credentials] # list of all email adresses
|
||||
emailsSelected = enquiries.choose("quels comptes ?", emails, multi=multiple)
|
||||
return([x for x in Credentials if x[0] in emailsSelected])
|
||||
|
||||
|
||||
def unban2():
|
||||
global _mail, _password
|
||||
_mail, _password = SelectAccount(False)[0]
|
||||
try :
|
||||
driver = FirefoxDriver()
|
||||
login()
|
||||
raise NotBanned
|
||||
except Banned :
|
||||
unban()
|
||||
except NotBanned :
|
||||
printf("you are not currently banned on this account")
|
||||
|
||||
def SavePointsFromFile(file):
|
||||
with open(file) as f:
|
||||
reader = csv.reader(f)
|
||||
points_list = list(reader)
|
||||
|
||||
for item in points_list:
|
||||
compte, points = item[0], item[1]
|
||||
add_to_database(compte, points, sql_host,sql_usr,sql_pwd,sql_database, save_if_fail=False)
|
||||
|
||||
with open(file, "w") as f:
|
||||
f.write("")
|
||||
|
||||
|
||||
def StartTask(task):
|
||||
ChangeColor(task, "blue")
|
||||
p.start_task(task)
|
||||
p.update(task, advance=0) # Reset the Task if it was already filled to 100%
|
||||
|
||||
def ShowTask(task):
|
||||
p.update(task, visible=True)
|
||||
|
||||
def AdvanceTask(task, pourcentage):
|
||||
p.update(task, advance=pourcentage)
|
||||
|
||||
def ChangeColor(task, newcolor):
|
||||
old = p.tasks[task].description
|
||||
old = old.split(']')
|
||||
old[0] = f"[{newcolor}"
|
||||
new = "]".join(old)
|
||||
p.update(task,description=new)
|
||||
|
||||
def ShowDefaultTask():
|
||||
for i in ["all", "carte1", "carte2", "carte0"]:
|
||||
ShowTask(task["daily"][i])
|
||||
|
||||
for i in ["PC", "Mobile"]:
|
||||
ShowTask(task[i])
|
||||
|
||||
if CUSTOM_START:
|
||||
CustomStart(Credentials)
|
||||
elif UNBAN:
|
||||
unban2()
|
||||
elif POINTS_FILE != "":
|
||||
SavePointsFromFile(POINTS_FILE)
|
||||
else:
|
||||
|
||||
with Progress(
|
||||
TextColumn("[progress.description]{task.description}"),
|
||||
BarColumn(),
|
||||
TaskProgressColumn(),
|
||||
TimeRemainingColumn(),
|
||||
TimeElapsedColumn(),
|
||||
) as p:
|
||||
task = modules.progress.dico(p)
|
||||
|
||||
for _mail, _password in Credentials:
|
||||
#system("pkill -9 firefox")
|
||||
print("\n\n")
|
||||
print(_mail)
|
||||
CustomSleep(1)
|
||||
printf("début du driver")
|
||||
driver = FirefoxDriver()
|
||||
printf("driver demarré")
|
||||
driver.implicitly_wait(7)
|
||||
|
||||
try:
|
||||
DailyRoutine()
|
||||
driver.quit()
|
||||
attente = uniform(1200, 3600)
|
||||
printf(f"finis. attente de {round(attente/60)}min")
|
||||
CustomSleep(attente)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("canceled")
|
||||
close()
|
852
V6.py
852
V6.py
|
@ -1,852 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
from modules.Classes.Config import Config
|
||||
from modules.Classes.DiscordLogger import DiscordLogger
|
||||
from modules.Classes.UserCredentials import UserCredentials
|
||||
from modules.Tools.logger import warning, critical
|
||||
from modules.cards import *
|
||||
from modules.config import *
|
||||
from modules.db import add_to_database
|
||||
from modules.driver_tools import *
|
||||
from modules.error import *
|
||||
|
||||
import random
|
||||
|
||||
|
||||
# create a webdriver
|
||||
def create_driver(mobile=False):
|
||||
pc_user_agent = (
|
||||
"Mozilla/5.0 (X11; Linux x86_64)"
|
||||
"AppleWebKit/537.36 (KHTML, like Gecko)"
|
||||
"Chrome/122.0.0.0 Safari/537.36 Edg/122.0.2088.46"
|
||||
)
|
||||
mobile_user_agent = (
|
||||
"Mozilla/5.0 (Linux; Android 7.0; Nexus 5 Build/MRA58N)"
|
||||
"AppleWebKit/537.36 (KHTML, like Gecko)"
|
||||
"Chrome/22 Mobile Safari/537.36"
|
||||
)
|
||||
|
||||
chrome_profile_dir = init_profile(config.UserCredentials.get_mail(), mobile=mobile)
|
||||
|
||||
# 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:
|
||||
arguments.append(f"--user-agent={mobile_user_agent}")
|
||||
else:
|
||||
arguments.append(f"--user-agent={pc_user_agent}")
|
||||
|
||||
# disabled as it may cause detection
|
||||
if config.proxy.is_enabled():
|
||||
arguments.append(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)
|
||||
return driver
|
||||
|
||||
|
||||
# close the tab currently on and go back to the one first, or the one specified
|
||||
def close_tab(tab, switch_to: int = 0) -> None:
|
||||
driver = config.WebDriver.driver
|
||||
driver.switch_to.window(tab)
|
||||
driver.close()
|
||||
driver.switch_to.window(driver.window_handles[switch_to])
|
||||
|
||||
|
||||
# play_quiz[N]([int : override]) make the quiz with N choice each time. They usually have between 4 and 10 questions.
|
||||
# override is the number of question, by default, it's the number of question in this specific quiz.
|
||||
# Can be useful in some case, where the program crashes before finishing the quiz
|
||||
def play_quiz2(override=10) -> None:
|
||||
info("Starting to play quiz 2.")
|
||||
driver = config.WebDriver.driver
|
||||
debug(f"override: {override}")
|
||||
for j in range(override):
|
||||
custom_sleep(uniform(3, 5))
|
||||
js_function = """
|
||||
function get_correct_answer(){
|
||||
function br(n) {
|
||||
for (var r, t = 0, i = 0; i < n.length; i++)
|
||||
t += n.charCodeAt(i);
|
||||
return r = parseInt(_G.IG.substr(_G.IG.length - 2), 16), t += r, t.toString()
|
||||
} // Ms check function
|
||||
function namedRAValue() { //allow calls to getRAValue
|
||||
return _w.getRAValue()
|
||||
};
|
||||
if (br(document.getElementById("rqAnswerOption0").attributes["data-option"].value) == namedRAValue()){
|
||||
return(0);
|
||||
}
|
||||
else {
|
||||
return(1);
|
||||
}
|
||||
};
|
||||
return(get_correct_answer())
|
||||
"""
|
||||
correct_answer_value = driver.execute_script(js_function)
|
||||
try:
|
||||
answer_elem = driver.find_element(By.ID, f"rqAnswerOption{correct_answer_value}")
|
||||
answer_elem.click()
|
||||
except exceptions.ElementNotInteractableException:
|
||||
answer_elem = driver.find_element(By.ID, f"rqAnswerOption{correct_answer_value}")
|
||||
driver.execute_script("arguments[0].click();", answer_elem)
|
||||
except Exception as e:
|
||||
log_error(e)
|
||||
break
|
||||
info("Quiz 2 done.")
|
||||
custom_sleep(3)
|
||||
|
||||
|
||||
def play_quiz8():
|
||||
driver = config.WebDriver.driver
|
||||
info(f"Starting Quiz 8")
|
||||
override = len(findall("<span id=\"rqQuestionState.\" class=\"emptyCircle\"></span>", driver.page_source)) + 1
|
||||
debug(f"override : {override}")
|
||||
correct_answers = ["Should", "be", "reset", "before", "you", "see", "this."] # supress warning
|
||||
try:
|
||||
for _ in range(override):
|
||||
sleep(uniform(3, 5))
|
||||
correct_answers = []
|
||||
for i in range(8):
|
||||
try:
|
||||
element = driver.find_element(By.ID, f"rqAnswerOption{i}")
|
||||
if 'iscorrectoption="True"' in element.get_attribute("outerHTML"):
|
||||
correct_answers.append(f'rqAnswerOption{i}')
|
||||
except Exception as e:
|
||||
warning(f"can't find rqAnswerOption{i}. Probably already clicked" + str(e))
|
||||
shuffle(correct_answers)
|
||||
for answer_id in correct_answers:
|
||||
wait_until_visible(By.ID, answer_id, timeout=20, browser=driver)
|
||||
try:
|
||||
answer_elem = driver.find_element(By.ID, answer_id)
|
||||
answer_elem.click()
|
||||
sleep(1)
|
||||
except exceptions.NoSuchElementException:
|
||||
driver.refresh()
|
||||
sleep(10)
|
||||
answer_elem = driver.find_element(By.ID, answer_id)
|
||||
answer_elem.click()
|
||||
except ElementClickInterceptedException:
|
||||
rgpd_popup(config)
|
||||
correct_answers.append(answer_id)
|
||||
|
||||
except Exception as e:
|
||||
log_error(f"{format_error(e)} \n Good answers : {' '.join(correct_answers)}")
|
||||
raise ValueError(format_error(e))
|
||||
info("Quiz 8 done.")
|
||||
custom_sleep(3)
|
||||
|
||||
|
||||
def play_quiz4(override: int = None):
|
||||
info(f"Starting Quiz 4")
|
||||
driver = config.WebDriver.driver
|
||||
|
||||
if not override:
|
||||
try: # fidelity quiz are much longer than usual ones
|
||||
override = int(findall('rqQuestionState([\d]{1,2})"', driver.page_source)[-1])
|
||||
except Exception as err:
|
||||
debug(err)
|
||||
override = 3
|
||||
debug(f"Override : {override}")
|
||||
|
||||
try:
|
||||
for i in range(override):
|
||||
custom_sleep(uniform(3, 5))
|
||||
txt = driver.page_source
|
||||
answer_option = search('correctAnswer":"([^"]+)', txt)[1]
|
||||
answer_option = answer_option.replace("\\u0027", "'") # replace Unicode weird symbols
|
||||
answer_element = driver.find_element(By.CSS_SELECTOR, f'[data-option="{answer_option}"]')
|
||||
try:
|
||||
answer_element.click()
|
||||
except exceptions.ElementNotInteractableException:
|
||||
driver.execute_script("arguments[0].click();", answer_element)
|
||||
|
||||
except Exception as e:
|
||||
log_error(e)
|
||||
raise ValueError(e)
|
||||
info("Quiz 4 done.")
|
||||
custom_sleep(3)
|
||||
|
||||
|
||||
# do_poll() answer a random thing to poll, on of daily activities
|
||||
def do_poll():
|
||||
info("Starting poll")
|
||||
driver = config.WebDriver.driver
|
||||
try:
|
||||
answer_elem = driver.find_element(By.ID, f"btoption{choice([0, 1])}")
|
||||
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:
|
||||
log_error(err)
|
||||
raise ValueError(err)
|
||||
info("Poll done.")
|
||||
custom_sleep(3)
|
||||
|
||||
|
||||
# Find each playable card and tries to click on it to earn points
|
||||
def all_cards():
|
||||
driver = config.WebDriver.driver
|
||||
|
||||
def check_welcome_tour() -> bool:
|
||||
if "rewards.bing.com/welcometour" not in driver.current_url:
|
||||
return False
|
||||
|
||||
info("Popup 'Explorer le programme' reçue")
|
||||
wait_until_visible(By.ID, "welcome-tour", timeout=5, browser=driver)
|
||||
custom_sleep(1.5)
|
||||
|
||||
welcome_tour = driver.find_element(By.ID, "welcome-tour")
|
||||
interest_button_box = welcome_tour.find_element(By.CLASS_NAME, "interest-buttons")
|
||||
interests = interest_button_box.find_elements(By.CLASS_NAME, "ng-binding")
|
||||
debug("Got the following interests: "+str(interests))
|
||||
random.choice(interests).click() # Choose interest
|
||||
custom_sleep(1.5)
|
||||
|
||||
claim_button = welcome_tour.find_element(By.ID, "claim-button")
|
||||
claim_button.click() # submit
|
||||
custom_sleep(1.5)
|
||||
return True
|
||||
|
||||
driver.get("https://rewards.bing.com")
|
||||
wait_until_visible(By.CLASS_NAME, "c-card-content", 10, driver)
|
||||
|
||||
card_list = driver.find_elements(By.CLASS_NAME, "c-card-content")
|
||||
custom_sleep(2)
|
||||
|
||||
try:
|
||||
promo()
|
||||
except Exception as e:
|
||||
debug(e)
|
||||
info("no promo card")
|
||||
|
||||
if len(card_list) < 10: # most likely an error during loading
|
||||
if "suspendu" in driver.page_source or "suspended" in driver.page_source:
|
||||
raise Banned()
|
||||
driver.refresh()
|
||||
card_list = driver.find_elements(By.CLASS_NAME, "c-card-content")
|
||||
if len(card_list) < 10:
|
||||
log_error("Less than 10 cards. Most likely an error with login.")
|
||||
return "Not enough cards"
|
||||
|
||||
for i in range(len(card_list)):
|
||||
debug(f"carte {i}")
|
||||
checked = False
|
||||
try:
|
||||
checked = "mee-icon-AddMedium" in card_list[i].get_attribute("innerHTML")
|
||||
|
||||
except StaleElementReferenceException:
|
||||
driver.refresh()
|
||||
card_list = driver.find_elements(By.CLASS_NAME, "c-card-content")
|
||||
warning(f"staled, {len(card_list)}")
|
||||
checked = "mee-icon-AddMedium" in card_list[i].get_attribute("innerHTML")
|
||||
|
||||
except IndexError:
|
||||
driver.get("https://rewards.bing.com")
|
||||
custom_sleep(10)
|
||||
card_list = driver.find_elements(By.CLASS_NAME, "c-card-content")
|
||||
try:
|
||||
checked = "mee-icon-AddMedium" in card_list[i].get_attribute("innerHTML")
|
||||
except IndexError:
|
||||
if i == len(card_list) and i > 15:
|
||||
checked = False
|
||||
|
||||
if not checked:
|
||||
continue
|
||||
|
||||
custom_sleep(1.5)
|
||||
check_welcome_tour()
|
||||
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
|
||||
custom_sleep(1.5)
|
||||
card_list[i].click()
|
||||
|
||||
if len(driver.window_handles) > 1:
|
||||
driver.switch_to.window(driver.window_handles[1])
|
||||
try_play(driver.title)
|
||||
close_tab(driver.window_handles[1])
|
||||
|
||||
try:
|
||||
driver.refresh()
|
||||
card_list = driver.find_elements(By.CLASS_NAME, "c-card-content")
|
||||
|
||||
if "mee-icon-AddMedium" not in card_list[i].get_attribute("innerHTML"):
|
||||
continue
|
||||
|
||||
check_welcome_tour()
|
||||
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
|
||||
card_list[i].click()
|
||||
|
||||
driver.switch_to.window(driver.window_handles[1])
|
||||
custom_sleep(10)
|
||||
log_error(f"Card {i} Can't be completed. Why MS ?")
|
||||
try:
|
||||
try_play(driver.title) # go back to the main page
|
||||
try:
|
||||
close_tab(driver.window_handles[1])
|
||||
except Exception as e:
|
||||
debug(e)
|
||||
except Exception as e:
|
||||
debug(e)
|
||||
driver.get("https://rewards.bing.com")
|
||||
|
||||
except Exception as err:
|
||||
log_error(err)
|
||||
custom_sleep(3)
|
||||
|
||||
|
||||
def promo():
|
||||
driver = config.WebDriver.driver
|
||||
for i in range(5):
|
||||
elm = driver.find_element(By.ID, "promo-item")
|
||||
wait_until_visible(By.ID, "promo-item", 5, driver)
|
||||
if not elm:
|
||||
break
|
||||
if i > 3:
|
||||
log_error("There is more than 3 promo cards, most likely an unskippable one.")
|
||||
try:
|
||||
driver.find_element(By.CSS_SELECTOR,
|
||||
'i[class="mee-icon pull-left icon mee-icon-Cancel ng-scope"]').click()
|
||||
except Exception as e:
|
||||
log_error(f"can't click to close : {e}")
|
||||
return ()
|
||||
try:
|
||||
elm.click()
|
||||
except Exception as e:
|
||||
driver.execute_script("arguments[0].click();", elm)
|
||||
warning(f"that shouldn't be there (promo), but the workaround seemed to work {e}")
|
||||
custom_sleep(3)
|
||||
if len(driver.window_handles) > 1:
|
||||
driver.switch_to.window(driver.window_handles[len(driver.window_handles) - 1])
|
||||
try_play(driver.title)
|
||||
close_tab(driver.window_handles[1])
|
||||
else:
|
||||
try:
|
||||
spotify(driver)
|
||||
except Exception as e:
|
||||
warning(f"no new windows {format_error(e)}")
|
||||
driver.get("https://rewards.bing.com")
|
||||
driver.refresh()
|
||||
custom_sleep(3)
|
||||
|
||||
|
||||
# Find out which type of action to do
|
||||
def try_play(nom="unknown"):
|
||||
driver = config.WebDriver.driver
|
||||
rgpd_popup(config)
|
||||
|
||||
def play(number):
|
||||
if number in [8, 9]:
|
||||
try:
|
||||
debug(f"Quiz 8 detected on `{nom}`.")
|
||||
play_quiz8()
|
||||
except Exception as err:
|
||||
error(f"fail of PlayQuiz 8. Aborted {err}")
|
||||
|
||||
elif number in [4, 5]:
|
||||
try:
|
||||
debug(f"Quiz 4 detected on `{nom}`")
|
||||
play_quiz4()
|
||||
except Exception as err:
|
||||
error(f"Fail of PlayQuiz 4. Aborted {err}.")
|
||||
|
||||
elif number in [2, 3]:
|
||||
try:
|
||||
debug(f"\033[96mQuiz 2 detected on `{nom}`\033[0m")
|
||||
play_quiz2()
|
||||
except Exception as err:
|
||||
error(f"fail of PlayQuiz 2. Aborted {err}")
|
||||
else:
|
||||
error("`rqAnswerOption` present in page but no action to do.")
|
||||
|
||||
custom_sleep(uniform(3, 5))
|
||||
|
||||
if "pas connecté à Microsoft Rewards" in driver.page_source:
|
||||
custom_sleep(5)
|
||||
driver.find_element(By.CSS_SELECTOR, '[onclick="setsrchusr()"]').click()
|
||||
custom_sleep(5)
|
||||
rgpd_popup(config)
|
||||
custom_sleep(5)
|
||||
debug("Detected and fixed connection popup")
|
||||
|
||||
if "bt_PollRadio" in driver.page_source:
|
||||
debug("Poll detected")
|
||||
do_poll()
|
||||
|
||||
elif search("([0-9]) de ([0-9]) finalisée", driver.page_source):
|
||||
info("On fidelity page.")
|
||||
fidelity()
|
||||
|
||||
elif wait_until_visible(By.ID, "rqStartQuiz", 5, driver):
|
||||
custom_sleep(3)
|
||||
driver.find_element(By.ID, "rqStartQuiz").click() # start the quiz
|
||||
answer_number = driver.page_source.count("rqAnswerOption")
|
||||
play(answer_number)
|
||||
|
||||
elif "rqQuestionState" in driver.page_source:
|
||||
number = driver.page_source.count("rqAnswerOption")
|
||||
warning(f"recovery detected. quiz : {number}")
|
||||
play(number - 1)
|
||||
|
||||
else:
|
||||
info(f"Nothing to do on page `{nom}`")
|
||||
custom_sleep(uniform(3, 5))
|
||||
|
||||
|
||||
# Login with password or with cookies.
|
||||
# The driver should be in the same state on both case
|
||||
def login_part_1():
|
||||
info("Starting part 1 of login")
|
||||
driver = config.WebDriver.driver
|
||||
driver.get("https://login.live.com")
|
||||
wait_until_visible(By.ID, "i0116", browser=driver)
|
||||
send_wait_and_confirm(
|
||||
driver.find_element(By.ID, "i0116"),
|
||||
config.UserCredentials.get_mail()
|
||||
)
|
||||
wait_until_visible(By.ID, "i0118", browser=driver)
|
||||
send_wait_and_confirm(
|
||||
driver.find_element(By.ID, "i0118"),
|
||||
config.UserCredentials.get_password()
|
||||
)
|
||||
# 2FA
|
||||
try:
|
||||
if not wait_until_visible(By.ID, "idTxtBx_SAOTCC_OTC", browser=driver, timeout=5, raise_error=False):
|
||||
custom_sleep(2)
|
||||
return
|
||||
|
||||
tfa = config.UserCredentials.get_tfa()
|
||||
if tfa is None:
|
||||
error("2FA needed but no code available for this account, sending error")
|
||||
raise ValueError("2FA needed but no code available for this account")
|
||||
else:
|
||||
a2f_code = tfa.now()
|
||||
|
||||
info(f"Need 2FA, I have code: {a2f_code}")
|
||||
send_wait_and_confirm(
|
||||
driver.find_element(By.ID, "idTxtBx_SAOTCC_OTC"),
|
||||
a2f_code
|
||||
)
|
||||
except Exception as err:
|
||||
log_error(err)
|
||||
|
||||
|
||||
# Accept all cookies question, and check if the account is locked
|
||||
def login_part_2():
|
||||
driver = config.WebDriver.driver
|
||||
custom_sleep(5)
|
||||
|
||||
if 'Abuse' in driver.current_url:
|
||||
raise Banned()
|
||||
|
||||
if 'identity' in driver.current_url:
|
||||
raise Identity()
|
||||
|
||||
if 'notice' in driver.current_url:
|
||||
driver.find_element(By.ID, "id__0").click()
|
||||
|
||||
if "proof" in driver.current_url:
|
||||
driver.find_element(By.ID, "iLooksGood")
|
||||
|
||||
for elm_id in ["checkboxField", "KmsiCheckboxField", "acceptButton", "iNext", "id__0", "iLooksGood", "idSIButton9",
|
||||
"iCancel"]:
|
||||
if get_domain(driver) == "account.microsoft.com":
|
||||
break
|
||||
try:
|
||||
driver.find_element(By.ID, elm_id).click()
|
||||
except Exception as e:
|
||||
debug(e)
|
||||
|
||||
wait_until_visible(By.CSS_SELECTOR, '[data-bi-id="sh-sharedshell-home"]', 20, driver)
|
||||
|
||||
|
||||
# login() tries to login to your Microsoft account.
|
||||
# it uses global variable g._mail and g._password to 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
|
||||
try:
|
||||
if not logged_in():
|
||||
login_part_1()
|
||||
login_part_2()
|
||||
driver.get("https://rewards.bing.com/")
|
||||
except Banned:
|
||||
raise Banned()
|
||||
except Identity:
|
||||
raise Banned()
|
||||
except Exception as err:
|
||||
critical("Error not caught during login." + format_error(err))
|
||||
log_error(err)
|
||||
driver.quit()
|
||||
return False
|
||||
|
||||
|
||||
# Makes 30 search as PC Edge
|
||||
def bing_pc_search(override=randint(35, 40)):
|
||||
driver = config.WebDriver.driver
|
||||
driver.get(f"https://www.bing.com/search?q={config.wordlist.get_word().replace(' ', '+')}")
|
||||
custom_sleep(uniform(1, 2))
|
||||
rgpd_popup(config)
|
||||
send_keys_wait(
|
||||
driver.find_element(By.ID, "sb_form_q"),
|
||||
Keys.BACKSPACE + Keys.BACKSPACE + Keys.BACKSPACE + Keys.BACKSPACE + Keys.BACKSPACE + Keys.BACKSPACE
|
||||
)
|
||||
|
||||
for _ in range(override):
|
||||
word = config.wordlist.get_word()
|
||||
try:
|
||||
send_keys_wait(driver.find_element(By.ID, "sb_form_q"), word)
|
||||
driver.find_element(By.ID, "sb_form_q").send_keys(Keys.ENTER)
|
||||
except Exception as e:
|
||||
error(e)
|
||||
sleep(10)
|
||||
driver.get(f'https://www.bing.com/search?q={word}')
|
||||
sleep(3)
|
||||
send_keys_wait(driver.find_element(By.ID, "sb_form_q"), word)
|
||||
driver.find_element(By.ID, "sb_form_q").send_keys(Keys.ENTER)
|
||||
custom_sleep(uniform(3, 7))
|
||||
try:
|
||||
driver.find_element(By.ID, "sb_form_q").clear()
|
||||
except Exception as e:
|
||||
error(e)
|
||||
try:
|
||||
driver.get('https://www.bing.com/search?q=plans')
|
||||
driver.find_element(By.ID, "sb_form_q").clear()
|
||||
except Exception as e:
|
||||
log_error(f"clear la barre de recherche - {format_error(e)}") # what is this message ??? todo
|
||||
|
||||
|
||||
# Sends current account's points to database
|
||||
def log_points():
|
||||
driver = config.WebDriver.driver
|
||||
account = config.UserCredentials.get_mail()
|
||||
|
||||
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
|
||||
|
||||
custom_sleep(uniform(3, 20))
|
||||
account_name = account.split("@")[0]
|
||||
|
||||
try:
|
||||
add_to_database(account_name, points)
|
||||
except Exception as e:
|
||||
log_error(e)
|
||||
|
||||
|
||||
# todo: refactor and check if it works at all
|
||||
def fidelity():
|
||||
driver = config.WebDriver.driver
|
||||
|
||||
def sub_fidelity():
|
||||
try:
|
||||
wait_until_visible(By.CSS_SELECTOR, 'div[class="pull-left spacer-48-bottom punchcard-row"]', browser=driver)
|
||||
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 = [0, 0, 0]
|
||||
for _ in range(int(answer_number[2]) - int(answer_number[1])):
|
||||
driver.refresh()
|
||||
custom_sleep(2)
|
||||
card_elem = driver.find_element(By.CLASS_NAME, "spacer-48-bottom")
|
||||
try:
|
||||
button_text = search('<span class="pull-left margin-right-15">([^<^>]+)</span>',
|
||||
card_elem.get_attribute("innerHTML"))[1]
|
||||
button_card = driver.find_element(By.XPATH, f'//span[text()="{button_text}"]')
|
||||
button_card.click()
|
||||
except Exception as e1:
|
||||
try:
|
||||
recover_elem = driver.find_element(By.XPATH,
|
||||
'/html/body/div[1]/div[2]/main/div[2]/div[2]/div[7]/div[3]/div[1]/a')
|
||||
recover_elem.click()
|
||||
except Exception as e2:
|
||||
log_error(f"Fidelity: Multiples error - e1 : {format_error(e1)} - e2 {format_error(e2)}")
|
||||
break
|
||||
custom_sleep(uniform(3, 5))
|
||||
driver.switch_to.window(driver.window_handles[2])
|
||||
try_play(driver.title)
|
||||
custom_sleep(uniform(3, 5))
|
||||
try:
|
||||
close_tab(driver.window_handles[2], 1)
|
||||
except Exception as err:
|
||||
error(err)
|
||||
info("fidelity - done")
|
||||
except Exception as err:
|
||||
log_error(err)
|
||||
|
||||
if driver.current_url != "https://rewards.bing.com":
|
||||
driver.get("https://rewards.bing.com")
|
||||
try:
|
||||
pause = driver.find_element(By.CSS_SELECTOR, f'[class="c-action-toggle c-glyph f-toggle glyph-pause"]')
|
||||
pause.click()
|
||||
except Exception as e:
|
||||
error(f"Error while clicking pause. Probably no cards. {e}")
|
||||
return "no cards"
|
||||
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()
|
||||
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():
|
||||
driver = config.WebDriver.driver
|
||||
try:
|
||||
alert = driver.switch_to.alert
|
||||
alert.dismiss()
|
||||
except exceptions.NoAlertPresentException:
|
||||
pass
|
||||
except Exception as err:
|
||||
log_error(err)
|
||||
|
||||
|
||||
# todo: be coherent with pc search regarding error management
|
||||
def bing_mobile_search(cred: UserCredentials, override=randint(22, 25)):
|
||||
config.WebDriver.set_mobile_driver(create_driver(mobile=True))
|
||||
config.WebDriver.switch_to_driver("Mobile")
|
||||
driver = config.WebDriver.driver
|
||||
|
||||
try:
|
||||
login()
|
||||
mot = config.wordlist.get_word().replace(" ", "+")
|
||||
driver.get(f"https://www.bing.com/search?q={mot}")
|
||||
custom_sleep(uniform(1, 2))
|
||||
rgpd_popup(config)
|
||||
custom_sleep(uniform(1, 1.5))
|
||||
for i in range(override): # 20
|
||||
try:
|
||||
mot = config.wordlist.get_word()
|
||||
send_keys_wait(driver.find_element(By.ID, "sb_form_q"), mot)
|
||||
driver.find_element(By.ID, "sb_form_q").send_keys(Keys.ENTER)
|
||||
custom_sleep(uniform(3, 7))
|
||||
mobile_alert_popup() # check for alert (asking for position or for allowing notifications)
|
||||
driver.find_element(By.ID, "sb_form_q").clear()
|
||||
except Exception as err:
|
||||
error(err)
|
||||
driver.refresh()
|
||||
custom_sleep(30)
|
||||
i -= 1
|
||||
driver.quit()
|
||||
|
||||
except Exception as err:
|
||||
log_error(err)
|
||||
driver.quit()
|
||||
|
||||
finally:
|
||||
config.WebDriver.switch_to_driver("PC")
|
||||
|
||||
|
||||
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.")
|
||||
raise Banned()
|
||||
|
||||
except Identity:
|
||||
log_error("This account has an issue.")
|
||||
return
|
||||
|
||||
try:
|
||||
all_cards()
|
||||
except Banned:
|
||||
log_error("banned")
|
||||
raise Banned
|
||||
except Exception as err:
|
||||
log_error(err)
|
||||
|
||||
try:
|
||||
fidelity()
|
||||
except Exception as err:
|
||||
log_error(err)
|
||||
|
||||
try:
|
||||
bing_pc_search()
|
||||
except Exception as err:
|
||||
log_error(err)
|
||||
|
||||
try:
|
||||
bing_mobile_search(cred)
|
||||
except Exception as err:
|
||||
log_error(err)
|
||||
|
||||
try:
|
||||
log_points()
|
||||
except Exception as err:
|
||||
log_error(err)
|
||||
|
||||
|
||||
def json_start(json_entry, cred: UserCredentials):
|
||||
json_entry = json.loads(json_entry)
|
||||
|
||||
config.set_display(SmartDisplay(backend="xvnc", size=(1920, 1080), rfbport=2345, color_depth=24))
|
||||
config.display.start()
|
||||
account_id = 0
|
||||
while config.UserCredentials.is_valid():
|
||||
start = False
|
||||
for action in ["unban", "tout", "pc", "mobile", "daily"]:
|
||||
try:
|
||||
if str(account_id) in json_entry[action]:
|
||||
start = True
|
||||
info(f"{cred.get_mail()} : {action}")
|
||||
except KeyError:
|
||||
pass
|
||||
if start:
|
||||
config.WebDriver.set_pc_driver(create_driver())
|
||||
config.WebDriver.switch_to_driver("PC")
|
||||
driver = config.WebDriver.driver
|
||||
try:
|
||||
if "unban" in json_entry and str(account_id) in json_entry["unban"]:
|
||||
login_part_1()
|
||||
info("\nGO TO example.com TO PROCEED or wait 1200 secs.")
|
||||
for _ in range(1200):
|
||||
sleep(1)
|
||||
if driver.current_url == "https://example.com/":
|
||||
info("proceeding")
|
||||
break
|
||||
else:
|
||||
login()
|
||||
except KeyError:
|
||||
login()
|
||||
try:
|
||||
if str(account_id) in json_entry["tout"]:
|
||||
daily_routine(cred, True)
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
if str(account_id) in json_entry["daily"]:
|
||||
try:
|
||||
all_cards()
|
||||
except Exception as e:
|
||||
log_error(e)
|
||||
except KeyError:
|
||||
pass
|
||||
try:
|
||||
if str(account_id) in json_entry["pc"]:
|
||||
try:
|
||||
bing_pc_search()
|
||||
except Exception as e:
|
||||
log_error(e)
|
||||
except KeyError:
|
||||
pass
|
||||
try:
|
||||
if str(account_id) in json_entry["mobile"]:
|
||||
try:
|
||||
bing_mobile_search(cred)
|
||||
except Exception as e:
|
||||
log_error(e)
|
||||
except KeyError:
|
||||
pass
|
||||
try:
|
||||
log_points()
|
||||
except Exception as e:
|
||||
error(f"CustomStart {e}")
|
||||
driver.close()
|
||||
cred.next_account()
|
||||
account_id += 1
|
||||
config.display.stop()
|
||||
|
||||
|
||||
def default_start():
|
||||
if config.vnc_enabled():
|
||||
config.set_display(SmartDisplay(backend="xvnc", size=(1920, 1080), rfbport=config.vnc, color_depth=24))
|
||||
else:
|
||||
config.set_display(SmartDisplay(size=(1920, 1080)))
|
||||
config.display.start()
|
||||
|
||||
while config.UserCredentials.is_valid():
|
||||
custom_sleep(1)
|
||||
info("Starting and configuring driver.")
|
||||
config.WebDriver.set_pc_driver(create_driver())
|
||||
config.WebDriver.switch_to_driver("PC")
|
||||
info("Driver started.")
|
||||
config.WebDriver.pc_driver.implicitly_wait(3)
|
||||
try:
|
||||
wait_time = uniform(1200, 3600)
|
||||
wait_time = 10 # the display closes when I ctrl + c
|
||||
info(f"Waiting for {round(wait_time / 60)}min before starting")
|
||||
custom_sleep(wait_time)
|
||||
daily_routine(config.UserCredentials)
|
||||
config.WebDriver.pc_driver.quit()
|
||||
except KeyboardInterrupt:
|
||||
critical("Canceled by user. Closing driver and display.")
|
||||
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()
|
||||
|
||||
|
||||
def log_error(msg):
|
||||
DiscordLogger(config).send(msg)
|
||||
|
||||
|
||||
def check_updated():
|
||||
debug(f"updated: {config.has_been_updated()}")
|
||||
if config.has_been_updated():
|
||||
config.discord.wh.send(f"Updated to {config.version}", username="update",
|
||||
avatar_url="https://cdn-icons-png.flaticon.com/512/1688/1688988.png")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
config = Config(args)
|
||||
check_updated()
|
||||
match config.start:
|
||||
case "json":
|
||||
json_start(config.json_entry, config.UserCredentials)
|
||||
|
||||
case "default":
|
||||
default_start()
|
12
build.sh
12
build.sh
|
@ -1,12 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
docker-do () { # Check if sudo needs to be used
|
||||
if id -nG "$(whoami)" | grep -qw "docker"; then
|
||||
docker $@
|
||||
else
|
||||
sudo docker $@
|
||||
fi
|
||||
}
|
||||
|
||||
docker-do build --network host -t msrewards .
|
||||
docker-do run -d --restart unless-stopped -p 1234:1234 -p 2345:2345 -ti --shm-size=2gb --name MsRewards msrewards
|
13
clean.sh
13
clean.sh
|
@ -1,13 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
docker-do () { # Check if sudo needs to be used
|
||||
if id -nG "$(whoami)" | grep -qw "docker"; then
|
||||
docker $@
|
||||
else
|
||||
sudo docker $@
|
||||
fi
|
||||
}
|
||||
|
||||
docker-do stop MsRewards
|
||||
docker-do rm MsRewards
|
||||
docker-do image rm msrewards
|
|
@ -1,193 +0,0 @@
|
|||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "-- Grafana --"
|
||||
},
|
||||
"enable": false,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"id": 1,
|
||||
"links": [],
|
||||
"liveNow": false,
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "frser-sqlite-datasource",
|
||||
"uid": "bed26262-6b98-4dfc-a95d-f8bd39b5d09c"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"mappings": [],
|
||||
"max": 10000,
|
||||
"min": 0,
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "dark-red",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "dark-yellow",
|
||||
"value": 2000
|
||||
},
|
||||
{
|
||||
"color": "green",
|
||||
"value": 7500
|
||||
},
|
||||
{
|
||||
"color": "blue",
|
||||
"value": 10000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 11,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"id": 3,
|
||||
"options": {
|
||||
"displayMode": "gradient",
|
||||
"minVizHeight": 10,
|
||||
"minVizWidth": 0,
|
||||
"orientation": "auto",
|
||||
"reduceOptions": {
|
||||
"calcs": [
|
||||
"lastNotNull"
|
||||
],
|
||||
"fields": "",
|
||||
"values": false
|
||||
},
|
||||
"showUnfilled": true,
|
||||
"valueMode": "color"
|
||||
},
|
||||
"pluginVersion": "10.0.3",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "frser-sqlite-datasource",
|
||||
"uid": "bed26262-6b98-4dfc-a95d-f8bd39b5d09c"
|
||||
},
|
||||
"queryText": "SELECT\n unixepoch() as time,\n c.compte,\n c.last_pts as \"\"\nFROM \n comptes c;\n",
|
||||
"queryType": "time series",
|
||||
"rawQueryText": "SELECT\n unixepoch() as time,\n c.compte,\n c.last_pts as \"\"\nFROM \n comptes c;\n",
|
||||
"refId": "A",
|
||||
"timeColumns": [
|
||||
"time",
|
||||
"ts"
|
||||
]
|
||||
}
|
||||
],
|
||||
"title": "Account points",
|
||||
"type": "bargauge"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "frser-sqlite-datasource",
|
||||
"uid": "bed26262-6b98-4dfc-a95d-f8bd39b5d09c"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"mappings": [],
|
||||
"max": 300,
|
||||
"min": 0,
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "dark-red",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "dark-green",
|
||||
"value": 200
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 11,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 11
|
||||
},
|
||||
"id": 4,
|
||||
"options": {
|
||||
"displayMode": "gradient",
|
||||
"minVizHeight": 10,
|
||||
"minVizWidth": 0,
|
||||
"orientation": "auto",
|
||||
"reduceOptions": {
|
||||
"calcs": [
|
||||
"lastNotNull"
|
||||
],
|
||||
"fields": "",
|
||||
"values": false
|
||||
},
|
||||
"showUnfilled": true,
|
||||
"valueMode": "color"
|
||||
},
|
||||
"pluginVersion": "10.0.3",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "frser-sqlite-datasource",
|
||||
"uid": "bed26262-6b98-4dfc-a95d-f8bd39b5d09c"
|
||||
},
|
||||
"queryText": "SELECT\n unixepoch() as time,\n c.compte as metric,\n c.last_pts - d2.points as ''\nFROM \n comptes c \nLEFT OUTER JOIN \n daily d1 \nON \n c.compte = d1.compte \nAND \n d1.date = date() \n LEFT OUTER JOIN daily d2 ON c.compte = d2.compte AND d2.date = DATE('now','-1 day')\nORDER BY d1.points DESC",
|
||||
"queryType": "time series",
|
||||
"rawQueryText": "SELECT\n unixepoch() as time,\n c.compte as metric,\n c.last_pts - d2.points as ''\nFROM \n comptes c \nLEFT OUTER JOIN \n daily d1 \nON \n c.compte = d1.compte \nAND \n d1.date = date() \n LEFT OUTER JOIN daily d2 ON c.compte = d2.compte AND d2.date = DATE('now','-1 day')\nORDER BY d1.points DESC",
|
||||
"refId": "A",
|
||||
"timeColumns": [
|
||||
"time",
|
||||
"ts"
|
||||
]
|
||||
}
|
||||
],
|
||||
"title": "Daily progress",
|
||||
"type": "bargauge"
|
||||
}
|
||||
],
|
||||
"refresh": "",
|
||||
"schemaVersion": 38,
|
||||
"style": "dark",
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "",
|
||||
"title": "Stats",
|
||||
"uid": "e70d4980-36d1-4107-90b0-d9164ae8ead4",
|
||||
"version": 14,
|
||||
"weekStart": ""
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
printf "\nsetting up NGINX\n"
|
||||
|
||||
rm /etc/nginx/sites-available/default
|
||||
echo "
|
||||
map \$http_upgrade \$connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
upstream grafana {
|
||||
server localhost:3000;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 1234;
|
||||
server_name localhost;
|
||||
location /grafana {
|
||||
proxy_pass http://localhost:3000;
|
||||
rewrite ^/grafana/(.*) /\$1 break;
|
||||
proxy_set_header Host \$host;
|
||||
}
|
||||
location /grafana/api/live/ {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection \$connection_upgrade;
|
||||
proxy_set_header Host \$http_host;
|
||||
proxy_pass http://grafana;
|
||||
rewrite ^/grafana/(.*) /\$1 break;
|
||||
}
|
||||
|
||||
location /novnc/ {
|
||||
proxy_pass http://127.0.0.1:6080/;
|
||||
}
|
||||
|
||||
location /novnc/websockify {
|
||||
proxy_pass http://127.0.0.1:6080/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Host \$host;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-For \$remote_addr;
|
||||
proxy_set_header Host \$http_host;
|
||||
proxy_pass "http://127.0.0.1:6666";
|
||||
chunked_transfer_encoding off;
|
||||
proxy_buffering off;
|
||||
add_header X-Accel-Buffering no;
|
||||
}
|
||||
|
||||
}
|
||||
" >> /etc/nginx/sites-available/default
|
||||
printf "\nNGINX configuration successfull\n"
|
||||
|
||||
printf "\ncreating sqlite databases\n"
|
||||
sqlite3 /app/MsRewards-Reborn/MsRewards.db "CREATE TABLE daily (id INTEGER PRIMARY KEY,compte TEXT,points int,date TEXT);"
|
||||
sqlite3 /app/MsRewards-Reborn/MsRewards.db "CREATE TABLE comptes (id INTEGER PRIMARY KEY,compte TEXT,last_pts int, banned int);"
|
||||
|
||||
printf "\nconfigurating grafana\n"
|
||||
|
||||
cp /app/MsRewards-Reborn/config/grafana.ini /etc/grafana/
|
||||
|
||||
printf "setting up default dashboard"
|
||||
cp /app/MsRewards-Reborn/config/Stats-dashbord.json /usr/share/grafana/public/dashboards/home.json
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
[server]
|
||||
root_url = %(protocol)s://localhost:3000/grafana/
|
||||
|
||||
[security]
|
||||
allow_embedding = true
|
||||
|
||||
[auth.anonymous]
|
||||
enabled = true
|
||||
|
||||
org_name = Main Org.
|
|
@ -1,19 +0,0 @@
|
|||
sleep 30
|
||||
curl -X "POST" "http://localhost:1234/grafana/api/datasources" \
|
||||
-H "Content-Type: application/json" \
|
||||
--user admin:admin \
|
||||
--data-raw $'{"id":1,"uid":"bed26262-6b98-4dfc-a95d-f8bd39b5d09c","orgId":1,"name":"SQLite","type":"frser-sqlite-datasource","typeName":"SQLite","typeLogoUrl":"public/plugins/frser-sqlite-datasource/img/logo.svg","access":"proxy","url":"","user":"","database":"","basicAuth":false,"isDefault":true,"jsonData":{"attachLimit":0,"path":"/app/MsRewards-Reborn/MsRewards.db","pathPefix":"file:"},"readOnly":false}'
|
||||
|
||||
curl 'http://localhost:1234/grafana/api/dashboards/import' \
|
||||
-H 'content-type: application/json' \
|
||||
-H 'x-grafana-org-id: 1' \
|
||||
--user admin:admin \
|
||||
--data-raw $'{"dashboard":{"annotations":{"list":[{"builtIn":1,"datasource":{"type":"grafana","uid":"-- Grafana --"},"enable":true,"hide":true,"iconColor":"rgba(0, 211, 255, 1)","name":"Annotations & Alerts","type":"dashboard"}]},"editable":true,"fiscalYearStartMonth":0,"graphTooltip":0,"id":null,"links":[],"liveNow":false,"panels":[{"datasource":{"type":"frser-sqlite-datasource","uid":"bed26262-6b98-4dfc-a95d-f8bd39b5d09c"},"fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"max":10000,"thresholds":{"mode":"absolute","steps":[{"color":"dark-red","value":null},{"color":"dark-yellow","value":2000},{"color":"green","value":7500},{"color":"blue","value":10000}]}},"overrides":[]},"gridPos":{"h":11,"w":24,"x":0,"y":0},"id":3,"options":{"displayMode":"gradient","minVizHeight":10,"minVizWidth":0,"orientation":"auto","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showUnfilled":true,"valueMode":"color"},"pluginVersion":"10.0.3","targets":[{"datasource":{"type":"frser-sqlite-datasource","uid":"bed26262-6b98-4dfc-a95d-f8bd39b5d09c"},"queryText":"SELECT\\n unixepoch() as time,\\n c.compte,\\n c.last_pts as \\"\\"\\nFROM \\n comptes c;\\n","queryType":"time series","rawQueryText":"SELECT\\n unixepoch() as time,\\n c.compte,\\n c.last_pts as \\"\\"\\nFROM \\n comptes c;\\n","refId":"A","timeColumns":["time","ts"]}],"title":"Account points","type":"bargauge"},{"datasource":{"type":"frser-sqlite-datasource","uid":"bed26262-6b98-4dfc-a95d-f8bd39b5d09c"},"fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"max":300,"thresholds":{"mode":"absolute","steps":[{"color":"dark-red","value":null},{"color":"dark-green","value":200}]}},"overrides":[]},"gridPos":{"h":11,"w":24,"x":0,"y":11},"id":4,"options":{"displayMode":"gradient","minVizHeight":10,"minVizWidth":0,"orientation":"auto","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showUnfilled":true,"valueMode":"color"},"pluginVersion":"10.0.3","targets":[{"datasource":{"type":"frser-sqlite-datasource","uid":"bed26262-6b98-4dfc-a95d-f8bd39b5d09c"},"queryText":"SELECT\\n unixepoch() as time,\\n c.compte as metric,\\n c.last_pts - d2.points as \'\'\\nFROM \\n comptes c \\nLEFT OUTER JOIN \\n daily d1 \\nON \\n c.compte = d1.compte \\nAND \\n d1.date = date() \\n LEFT OUTER JOIN daily d2 ON c.compte = d2.compte AND d2.date = DATE(\'now\',\'-1 day\')\\nORDER BY d1.points DESC","queryType":"time series","rawQueryText":"SELECT\\n unixepoch() as time,\\n c.compte as metric,\\n c.last_pts - d2.points as \'\'\\nFROM \\n comptes c \\nLEFT OUTER JOIN \\n daily d1 \\nON \\n c.compte = d1.compte \\nAND \\n d1.date = date() \\n LEFT OUTER JOIN daily d2 ON c.compte = d2.compte AND d2.date = DATE(\'now\',\'-1 day\')\\nORDER BY d1.points DESC","refId":"A","timeColumns":["time","ts"]}],"title":"Daily progress","type":"bargauge"}],"refresh":"","schemaVersion":38,"style":"dark","tags":[],"templating":{"list":[]},"time":{"from":"now-6h","to":"now"},"timepicker":{},"timezone":"","title":"main","uid":"stats","version":14,"weekStart":""},"overwrite":true,"inputs":[],"folderUid":""}' \
|
||||
--compressed \
|
||||
--insecure
|
||||
|
||||
|
||||
websockify -D \
|
||||
--web /usr/share/novnc/ \
|
||||
6080 \
|
||||
localhost:2345
|
|
@ -1,19 +0,0 @@
|
|||
version: '3.8'
|
||||
|
||||
services:
|
||||
msrewards:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
# optional if you have Dockerfile in the same directory
|
||||
# arguments:
|
||||
# - ARG_NAME=value # If you have build arguments
|
||||
image: msrewards
|
||||
container_name: MsRewards
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "1234:1234"
|
||||
- "2345:2345"
|
||||
shm_size: 2gb
|
||||
volumes:
|
||||
- "./data/:/data"
|
|
@ -0,0 +1,162 @@
|
|||
#/usr/bin/python3.10
|
||||
|
||||
import configparser
|
||||
import os
|
||||
import shutil
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
|
||||
try :
|
||||
config_path = f"{os.path.abspath( os.path.dirname( __file__ ) )}/user_data/config.cfg"
|
||||
if config.read(config_path)==[] :
|
||||
raise NameError("le fichier n'existe pas")
|
||||
except :
|
||||
default_config = f"{os.path.abspath( os.path.dirname( __file__ ) )}/user_data/config.default"
|
||||
shutil.copyfile(default_config, config_path)
|
||||
config.read(config_path)
|
||||
|
||||
|
||||
|
||||
|
||||
def confirm(texte, default = False):
|
||||
if default :
|
||||
txt = '[Y/n]'
|
||||
else :
|
||||
txt = '[y/N]'
|
||||
|
||||
yes = ['y', 'yes', 'o', 'oui']
|
||||
no = ['n', 'non', 'no']
|
||||
a = input(f"{texte} {txt}").lower()
|
||||
if a in yes :
|
||||
return True
|
||||
elif a in no :
|
||||
return False
|
||||
return default
|
||||
|
||||
lang = "fr"
|
||||
|
||||
text = {"fr" : {
|
||||
"compte" : "entrer l'adresse mail du compte ",
|
||||
"mdp" : "entrez le mot de passe du compte ",
|
||||
"next" : "voulez vous ajouter un compte ? ",
|
||||
"finc" : "comptes en cours d'ajout ",
|
||||
"ajout" : "comptes ajouté ",
|
||||
"fidelity" : "avez vous un lien sur lequel le lien vers la page fidelité du mois est le seul contenu de la page ? ",
|
||||
"lien" : "entrez le lien ",
|
||||
"discorde" : "voulez vous envoyer les erreurs sur discord ? ",
|
||||
"w1" : "entrez le lien du WebHook pour envoyer les points ",
|
||||
"w2" : "entrez le lien du WebHook pour envoyer les erreurs ",
|
||||
"msqle" : "voulez vous untiliser une base de donnée ",
|
||||
"msqll" : "entrez le lien de la base de donnée ",
|
||||
"msqlu" : "entrez l'utilisateur de la base de donnée ",
|
||||
"msqlp" : "entrez le mot de passe de la base de donnée ",
|
||||
"msqlt" : "entrez le nom de la table de la base de donnée ",
|
||||
"proxye" : "voulez vous utiliser un proxy ",
|
||||
"proxyl" : "entrez le lien du proxy ",
|
||||
"proxyp" : "entrez le port du proxy "
|
||||
}
|
||||
}
|
||||
|
||||
t = text[lang]
|
||||
|
||||
def setup():
|
||||
setup_comptes()
|
||||
setup_settings()
|
||||
|
||||
|
||||
def setup_comptes():
|
||||
lc = []
|
||||
compte = input(t["compte"])
|
||||
mdp = input(t["mdp"])
|
||||
lc.append(f"{compte},{mdp}")
|
||||
for i in range(5):
|
||||
if confirm(t["next"], default = True):
|
||||
compte = input(t["compte"])
|
||||
mdp = input(t["mdp"])
|
||||
lc.append(f"{compte},{mdp}\n")
|
||||
else:
|
||||
print(t["finc"])
|
||||
break
|
||||
f = open('./user_data/login.csv', "w")
|
||||
for i in lc :
|
||||
f.write(i)
|
||||
f.close()
|
||||
print(t["ajout"])
|
||||
|
||||
#modifie le fichier de configuration
|
||||
edit_config_txt("logpath",f'{os.getcwd()}/user_data/login.csv')
|
||||
|
||||
|
||||
def edit_config_txt(ligne, contenu):
|
||||
f = open(config_path, "r")
|
||||
txt = f.readlines()
|
||||
f.close()
|
||||
if txt.count(txt) >1:
|
||||
raise NameError("il y a plus d'une occurence, echec de la modification")
|
||||
|
||||
for i in range(len(txt)) :
|
||||
name = txt[i].split(" = ")[0]
|
||||
if name == ligne:
|
||||
txt[i] = name + " = " + str(contenu) + "\n"
|
||||
|
||||
f = open(config_path, "w")
|
||||
for i in txt :
|
||||
f.write(i)
|
||||
f.close()
|
||||
|
||||
|
||||
def setup_settings():
|
||||
general()
|
||||
discord()
|
||||
proxy()
|
||||
sql()
|
||||
amazon()
|
||||
|
||||
def general():
|
||||
if confirm(t["fidelity"]):
|
||||
lien = input(t["lien"])
|
||||
edit_config_txt('FidelityLink',lien)
|
||||
|
||||
def discord():
|
||||
enabled = confirm(t["discorde"], default = True)
|
||||
if enabled :
|
||||
edit_config_txt("DiscordErrorEnabled", True)
|
||||
|
||||
edit_config_txt('DiscordSuccessEnabled', confirm("send success ?", default = True))
|
||||
w1 = input(t["w1"])
|
||||
edit_config_txt("successlink",w1)
|
||||
w2 = input(t["w2"])
|
||||
edit_config_txt("errorlink",w2)
|
||||
|
||||
def sql() :
|
||||
enabled = confirm(t["msqle"], default = False)
|
||||
if enabled :
|
||||
edit_config_txt("sql_enabled", True)
|
||||
lien = input(t["msqll"])
|
||||
edit_config_txt("host",lien)
|
||||
table = input(t["msqlt"])
|
||||
edit_config_txt("database",table)
|
||||
user = input(t["msqlu"])
|
||||
edit_config_txt("usr",user)
|
||||
pwd = input(t["msqlp"])
|
||||
edit_config_txt("pwd",pwd)
|
||||
|
||||
def proxy() :
|
||||
enabled = confirm(t["proxye"], default = False)
|
||||
if enabled :
|
||||
edit_config_txt("proxy_enabled", True)
|
||||
lien = input(t["proxyl"])
|
||||
edit_config_txt("url",lien)
|
||||
port = input(t["proxyp"])
|
||||
edit_config_txt("port",port)
|
||||
|
||||
def amazon():
|
||||
enabled = confirm("claim les recompenses automatiquement sur amazon ?", default = False)
|
||||
edit_config_txt("claim_amazon",enabled)
|
||||
|
||||
|
||||
LogPath = config["PATH"]["logpath"]
|
||||
if LogPath == "/your/path/to/loginandpass.csv" :
|
||||
setup()
|
||||
else :
|
||||
os.system("python3.10 V4.py")
|
|
@ -1,84 +0,0 @@
|
|||
import json
|
||||
|
||||
from discord import Webhook, RequestsWebhookAdapter
|
||||
|
||||
from modules.Classes.DiscordConfig import DiscordConfig, FakeWebHook
|
||||
from modules.Classes.Driver import Driver
|
||||
from modules.Classes.Proxy import Proxy
|
||||
from modules.Classes.UserCredentials import UserCredentials
|
||||
from modules.Classes.WordList import WordList
|
||||
|
||||
|
||||
class Config:
|
||||
def __init__(self, args):
|
||||
"""
|
||||
open config file
|
||||
"""
|
||||
with open("/app/MsRewards-Reborn/user_data/discord.json", "r") as inFile:
|
||||
discord = json.load(inFile)
|
||||
with open("/app/MsRewards-Reborn/user_data/settings.json", "r") as inFile:
|
||||
settings = json.load(inFile)
|
||||
with open("/app/MsRewards-Reborn/user_data/proxy.json", "r") as inFile:
|
||||
proxy = json.load(inFile)
|
||||
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
||||
config = json.load(inFile)
|
||||
|
||||
"""
|
||||
setup standalone stuff
|
||||
"""
|
||||
self.args = args
|
||||
self.start = "json" if args.json else "default"
|
||||
self.json_entry = args.json.replace("'", "\"")
|
||||
self.wordlist = WordList("/usr/share/dict/french")
|
||||
self.vnc = args.vnc
|
||||
self.version = args.update_version
|
||||
self.WebDriver = Driver()
|
||||
self.display = None
|
||||
|
||||
"""
|
||||
setup UserCredential
|
||||
"""
|
||||
self.UserCredentials = UserCredentials()
|
||||
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
||||
configs = json.load(inFile)
|
||||
for i in configs[str(args.config)]["accounts"]:
|
||||
d = configs[str(args.config)]["accounts"][i]
|
||||
self.UserCredentials.add(d["mail"], d["pwd"], d["2fa"])
|
||||
|
||||
"""
|
||||
Setup discord
|
||||
"""
|
||||
self.discord = DiscordConfig()
|
||||
self.discord.avatar_url = settings["avatarlink"]
|
||||
|
||||
if (
|
||||
"discord" in config[args.config]
|
||||
and config[args.config]["discord"] in discord
|
||||
and "errorsL" in discord[config[args.config]["discord"]]
|
||||
and discord[config[args.config]["discord"]]["errorsL"] != ""
|
||||
):
|
||||
self.discord.wh_link = discord[config[args.config]["discord"]]["errorsL"]
|
||||
self.discord.wh = Webhook.from_url(self.discord.wh_link, adapter=RequestsWebhookAdapter())
|
||||
else:
|
||||
self.discord.wh = FakeWebHook()
|
||||
|
||||
"""
|
||||
setup proxy
|
||||
"""
|
||||
proxy_conf = config[args.config]["proxy"]
|
||||
if proxy_conf != "-1":
|
||||
proxy_address = proxy[config[args.config]["proxy"]]["address"]
|
||||
proxy_port = proxy[config[args.config]["proxy"]]["port"]
|
||||
else:
|
||||
proxy_address = ""
|
||||
proxy_port = ""
|
||||
self.proxy = Proxy(proxy_conf, proxy_address, proxy_port)
|
||||
|
||||
def vnc_enabled(self):
|
||||
return self.vnc != "None"
|
||||
|
||||
def set_display(self, display):
|
||||
self.display = display
|
||||
|
||||
def has_been_updated(self):
|
||||
return self.version != "None"
|
|
@ -1,14 +0,0 @@
|
|||
from modules.Tools.logger import debug
|
||||
|
||||
|
||||
class DiscordConfig:
|
||||
def __init__(self):
|
||||
self.avatar_url = ""
|
||||
self.wh_link = None
|
||||
self.wh = None
|
||||
|
||||
|
||||
class FakeWebHook:
|
||||
def send(self, *args, **kwargs):
|
||||
debug(f"Used a webhook call without webhook url with {args} {kwargs}")
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
from discord import Embed, Colour, File
|
||||
|
||||
from modules.Classes.Config import Config
|
||||
from modules.Tools.logger import error
|
||||
from modules.Tools.tools import format_error
|
||||
|
||||
|
||||
class DiscordLogger:
|
||||
def __init__(self, config: Config):
|
||||
self.config = config
|
||||
|
||||
def send(self, message: str):
|
||||
driver = self.config.WebDriver.driver
|
||||
if type(message) is not str:
|
||||
message = format_error(message)
|
||||
error(message)
|
||||
with open("page.html", "w") as f:
|
||||
try:
|
||||
f.write(driver.page_source)
|
||||
except Exception as e:
|
||||
error(e)
|
||||
f.write("the driver has closed or crashed. Can't access page content")
|
||||
img = self.config.display.waitgrab()
|
||||
img.save("screenshot.png")
|
||||
|
||||
embed = Embed(
|
||||
title="An Error has occurred",
|
||||
description=str(message),
|
||||
colour=Colour.red(),
|
||||
)
|
||||
file = File("screenshot.png")
|
||||
embed.set_image(url="attachment://screenshot.png")
|
||||
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)
|
|
@ -1,25 +0,0 @@
|
|||
class Driver:
|
||||
def __init__(self):
|
||||
self.pc_driver = None
|
||||
self.mobile_driver = None
|
||||
self.driver = None
|
||||
|
||||
def set_pc_driver(self, pc_driver):
|
||||
self.pc_driver = pc_driver
|
||||
|
||||
def set_mobile_driver(self, mobile_driver):
|
||||
self.mobile_driver = mobile_driver
|
||||
|
||||
def switch_to_driver(self, driver: str):
|
||||
match driver.lower():
|
||||
case "pc":
|
||||
self.driver = self.pc_driver
|
||||
|
||||
case "mobile":
|
||||
self.driver = self.mobile_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"
|
|
@ -1,9 +0,0 @@
|
|||
class Proxy:
|
||||
def __init__(self, enabled: str, ip: str = None, port: str = None):
|
||||
self.ip = ip
|
||||
self.port = port
|
||||
self.enabled = enabled != "-1"
|
||||
|
||||
def is_enabled(self):
|
||||
return self.enabled
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
from pyotp import TOTP
|
||||
|
||||
from modules.Tools.logger import debug, warning
|
||||
|
||||
|
||||
class UserCredentials:
|
||||
def __init__(self):
|
||||
self.data = {}
|
||||
self.current = 0
|
||||
self.total = 0
|
||||
|
||||
def add(self, username: str, password: str, tfa: str = None):
|
||||
debug(
|
||||
f"adding account with data : Username: {username}, Password: {password}, 2FA: {'None' if tfa == '' else tfa}")
|
||||
self.data[self.total] = {
|
||||
"username": username,
|
||||
"password": password,
|
||||
"2fa": None if tfa == '' else tfa
|
||||
}
|
||||
self.total += 1
|
||||
|
||||
def tfa_enable(self):
|
||||
return self.data[self.current]["2fa"] is not None
|
||||
|
||||
def get_mail(self):
|
||||
return self.data[self.current]["username"]
|
||||
|
||||
def get_password(self):
|
||||
return self.data[self.current]["password"]
|
||||
|
||||
def get_tfa(self):
|
||||
if not self.tfa_enable():
|
||||
warning("Warning: TFA is not enabled. Can't get a TFA code.")
|
||||
return None
|
||||
return TOTP(self.data[self.current]["2fa"])
|
||||
|
||||
def next_account(self):
|
||||
self.current += 1
|
||||
if self.is_valid():
|
||||
debug(f"New credentials: {self.data[self.current]}")
|
||||
else:
|
||||
debug("No new credentials.")
|
||||
|
||||
def is_valid(self):
|
||||
return (self.current < self.total
|
||||
and self.get_mail() != "" and self.get_mail is not None)
|
|
@ -1,13 +0,0 @@
|
|||
import random
|
||||
|
||||
|
||||
class WordList:
|
||||
def __init__(self, path):
|
||||
with open(path, "r", encoding="utf-8") as h:
|
||||
lines = h.readlines()
|
||||
self.words = [x.replace('\n', "") for x in lines]
|
||||
|
||||
random.shuffle(self.words)
|
||||
|
||||
def get_word(self):
|
||||
return self.words.pop(0)
|
|
@ -1,8 +0,0 @@
|
|||
import undetected_chromedriver as uc
|
||||
from pyvirtualdisplay.smartdisplay import SmartDisplay
|
||||
|
||||
display = SmartDisplay(size=(1920, 1080))
|
||||
display.start()
|
||||
driver = uc.Chrome()
|
||||
driver.close()
|
||||
driver.close()
|
|
@ -1,47 +0,0 @@
|
|||
import logging
|
||||
|
||||
# ANSI escape codes for colors
|
||||
COLOR_CODES = {
|
||||
'RESET': '\033[0m',
|
||||
'BOLD': '\033[1m',
|
||||
'RED': '\033[31m',
|
||||
'GREEN': '\033[32m',
|
||||
'YELLOW': '\033[33m',
|
||||
'BLUE': '\033[34m',
|
||||
}
|
||||
|
||||
# Define colors for each log level
|
||||
LOG_COLORS = {
|
||||
'DEBUG': COLOR_CODES['BLUE'],
|
||||
'INFO': COLOR_CODES['GREEN'],
|
||||
'WARNING': COLOR_CODES['YELLOW'],
|
||||
'ERROR': COLOR_CODES['RED'],
|
||||
'CRITICAL': COLOR_CODES['BOLD'] + COLOR_CODES['RED'],
|
||||
}
|
||||
|
||||
|
||||
# Create a formatter with colors
|
||||
class ColoredFormatter(logging.Formatter):
|
||||
def format(self, record):
|
||||
log_level = record.levelname
|
||||
record.levelname = f"{LOG_COLORS.get(log_level, '')}{record.levelname}{COLOR_CODES['RESET']}"
|
||||
return super().format(record)
|
||||
|
||||
|
||||
# Set up the root logger
|
||||
root_logger = logging.getLogger(__name__)
|
||||
root_logger.setLevel(logging.INFO)
|
||||
|
||||
# Create a console handler and set the formatter
|
||||
ch = logging.StreamHandler()
|
||||
ch.setFormatter(ColoredFormatter('%(levelname)s: %(message)s'))
|
||||
|
||||
# Add the console handler to the root logger
|
||||
root_logger.addHandler(ch)
|
||||
|
||||
# Define log level functions
|
||||
debug = root_logger.debug
|
||||
info = root_logger.info
|
||||
warning = root_logger.warning
|
||||
error = root_logger.error
|
||||
critical = root_logger.critical
|
|
@ -1,36 +0,0 @@
|
|||
from time import sleep
|
||||
|
||||
from modules.Tools.logger import info, error
|
||||
|
||||
|
||||
# return current page domain
|
||||
def get_domain(driver):
|
||||
return driver.current_url.split("/")[2]
|
||||
|
||||
|
||||
def custom_sleep(temps):
|
||||
try:
|
||||
if False: # todo: change this awful condition
|
||||
points = ["⢿", "⣻", "⣽", "⣾", "⣷", "⣯", "⣟", "⡿"]
|
||||
passe = 0
|
||||
for _ in range(int(temps)):
|
||||
for i in range(8):
|
||||
sleep(0.125)
|
||||
passe += 0.125
|
||||
print(f"{points[i]} - {round(float(temps) - passe, 3)}", end="\r")
|
||||
print(" ", end="\r")
|
||||
else:
|
||||
sleep(temps)
|
||||
except KeyboardInterrupt:
|
||||
info("Wait canceled.")
|
||||
except Exception as err:
|
||||
error(err)
|
||||
|
||||
|
||||
def format_error(e) -> str:
|
||||
tb = e.__traceback__
|
||||
txt = ""
|
||||
while tb is not None:
|
||||
txt = txt + f" -> {tb.tb_frame.f_code.co_name} ({tb.tb_lineno}) "
|
||||
tb = tb.tb_next
|
||||
return txt + "\n" + str(e)
|
|
@ -1,48 +0,0 @@
|
|||
import requests
|
||||
import re
|
||||
from packaging import version
|
||||
import subprocess
|
||||
|
||||
from logger import critical, info, error
|
||||
|
||||
errorMessage = subprocess.run(['python3', 'generate_error.py'], check=False, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE).stderr.decode("utf-8")
|
||||
|
||||
versionPattern = "This version of ChromeDriver only supports Chrome version ([0-9]+)"
|
||||
|
||||
try:
|
||||
versionN = re.search(versionPattern, errorMessage)[1]
|
||||
except Exception as e:
|
||||
critical("Can't get version number from error")
|
||||
error(e)
|
||||
exit(0)
|
||||
|
||||
info(f"Needed version : '{versionN}'")
|
||||
|
||||
downloadUrl = "http://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/"
|
||||
r = requests.get(downloadUrl)
|
||||
|
||||
content = r.text
|
||||
|
||||
exactVersionList = re.findall(f"(google-chrome-stable_({versionN}.[0-9.]+)[^<^>^\"]+)", content)
|
||||
|
||||
try:
|
||||
best = exactVersionList[0]
|
||||
except Exception as e:
|
||||
critical("No version matches required version")
|
||||
error(e)
|
||||
exit(0)
|
||||
|
||||
for i in exactVersionList:
|
||||
if version.parse(i[1]) > version.parse(best[1]):
|
||||
best = i
|
||||
|
||||
chromeDebURL = f"http://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/{best[0]}"
|
||||
info(f"chrome deb URL : {chromeDebURL}")
|
||||
info("downloading chrome")
|
||||
|
||||
subprocess.call(['wget', "-O", "/tmp/chrome.deb", chromeDebURL])
|
||||
info("Chrome deb downloaded. Installing chrome")
|
||||
|
||||
subprocess.call(["dpkg", "-i", "/tmp/chrome.deb"])
|
||||
info("Chrome installed")
|
|
@ -1,34 +0,0 @@
|
|||
from modules.imports import *
|
||||
|
||||
|
||||
def welcome_tour(elm, driver):
|
||||
try :
|
||||
driver.find_element(By.CSS_SELECTOR, '[class="welcome-tour-next-button c-call-to-action c-glyph"]').click()
|
||||
except :
|
||||
pass
|
||||
driver.find_element(By.CSS_SELECTOR, '[class="quiz-link gray-button c-call-to-action c-glyph f-lightweight"]').click()
|
||||
sleep(5)
|
||||
driver.find_element(By.CSS_SELECTOR, '[class="c-glyph glyph-cancel"]').click()
|
||||
elm.click()
|
||||
driver.find_element(By.CSS_SELECTOR, '[class="quiz-link gray-button c-call-to-action c-glyph f-lightweight"]').click()
|
||||
sleep(5)
|
||||
driver.find_element(By.CSS_SELECTOR, '[class="c-glyph glyph-cancel"]').click()
|
||||
elm.click()
|
||||
driver.find_element(By.CSS_SELECTOR, '[class="quiz-link gray-button c-call-to-action c-glyph f-lightweight"]').click()
|
||||
sleep(5)
|
||||
driver.find_element(By.CSS_SELECTOR, '[class="c-glyph glyph-cancel"]').click()
|
||||
|
||||
def welcome_tour_NO(driver):
|
||||
try :
|
||||
driver.find_element(By.CSS_SELECTOR, '[class="welcome-tour-next-button c-call-to-action c-glyph"]').click()
|
||||
except :
|
||||
pass
|
||||
driver.find_element(By.CSS_SELECTOR, '[class="c-glyph glyph-cancel"]').click()
|
||||
sleep(5)
|
||||
|
||||
|
||||
def spotify(driver):
|
||||
sleep(5)
|
||||
driver.find_element(By.CSS_SELECTOR, '[data-bi-id="spotify-premium gratuit"]').click()
|
||||
sleep(5)
|
||||
close_tab(driver.window_handles[1])
|
|
@ -1,33 +1,158 @@
|
|||
#!/usr/bin/python3.10
|
||||
from modules.imports import *
|
||||
import configparser
|
||||
from csv import reader
|
||||
from os import sys, system, path
|
||||
from sys import platform
|
||||
import argparse
|
||||
from discord import ( # Importing discord.Webhook and discord.RequestsWebhookAdapter
|
||||
RequestsWebhookAdapter,
|
||||
Webhook,
|
||||
)
|
||||
from time import time
|
||||
from random import shuffle
|
||||
|
||||
"""
|
||||
Setup for option, like --override or --fulllog
|
||||
"""
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument(
|
||||
"-o",
|
||||
"--override",
|
||||
help="override",
|
||||
dest="override",
|
||||
action="store_true"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-u",
|
||||
"--unban",
|
||||
help="unban an account",
|
||||
dest="unban",
|
||||
action="store_true"
|
||||
)
|
||||
|
||||
|
||||
parser.add_argument(
|
||||
"-l",
|
||||
"--log",
|
||||
dest="log",
|
||||
help="enable logging in terminal",
|
||||
action="store_true"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-fl",
|
||||
"--fulllog",
|
||||
dest="fulllog",
|
||||
help="enable full logging in discord",
|
||||
action="store_true",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-r",
|
||||
"--risky",
|
||||
help="make the program faster, probably better risk of ban",
|
||||
dest="fast",
|
||||
action="store_true"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-c",
|
||||
"--config",
|
||||
help="Choose a specific config file",
|
||||
default=""
|
||||
type=argparse.FileType('r')
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--vnc",
|
||||
help="enable VNC",
|
||||
dest="vnc"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--version",
|
||||
help="display a message on discord to tell that the bot have been updated",
|
||||
dest="update_version",
|
||||
default="None"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--json",
|
||||
help="input json to start the bot with custom parameters",
|
||||
"-a",
|
||||
"--add-points",
|
||||
help="Add points to the database from a file and exit",
|
||||
dest="points_file",
|
||||
default=""
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
CUSTOM_START = args.override
|
||||
UNBAN = args.unban
|
||||
LOG = args.log
|
||||
FULL_LOG = args.fulllog
|
||||
FAST = args.fast
|
||||
if CUSTOM_START :
|
||||
LOG = True
|
||||
|
||||
POINTS_FILE = args.points_file
|
||||
|
||||
# global variables used later in the code
|
||||
LINUX_HOST = platform == "linux" # if the computer running this programm is linux, it allow more things
|
||||
START_TIME = time()
|
||||
driver = None
|
||||
|
||||
|
||||
if LINUX_HOST:
|
||||
import enquiries
|
||||
else:
|
||||
system("") # enable colors in windows cmd
|
||||
|
||||
#reading configuration
|
||||
|
||||
config_path = f"{path.abspath(path.dirname(path.dirname( __file__ )))}/user_data/config.cfg"
|
||||
if args.config :
|
||||
config_path = path.abspath(args.config.name)
|
||||
|
||||
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
config.read(config_path)
|
||||
|
||||
# path configurations
|
||||
MotPath = config["PATH"]["motpath"]
|
||||
CREDENTIALS_PATH = config["PATH"]["logpath"]
|
||||
|
||||
|
||||
# discord configuration
|
||||
DISCORD_SUCCESS_LINK = config["DISCORD"]["successlink"]
|
||||
DISCORD_ERROR_LINK = config["DISCORD"]["errorlink"]
|
||||
DISCORD_ENABLED_ERROR = config["DISCORD"]["DiscordErrorEnabled"] == "True"
|
||||
DISCORD_ENABLED_SUCCESS = config["DISCORD"]["DiscordSuccessEnabled"]== "True"
|
||||
|
||||
if DISCORD_ENABLED_ERROR:
|
||||
webhookFailure = Webhook.from_url(DISCORD_ERROR_LINK, adapter=RequestsWebhookAdapter())
|
||||
if DISCORD_ENABLED_SUCCESS:
|
||||
webhookSuccess = Webhook.from_url(DISCORD_SUCCESS_LINK, adapter=RequestsWebhookAdapter())
|
||||
|
||||
# base settings
|
||||
FidelityLink = config["SETTINGS"]["FidelityLink"]
|
||||
DISCORD_EMBED = config["SETTINGS"]["embeds"] == "True" #print new point value in an embed
|
||||
Headless = config["SETTINGS"]["headless"] == "True"
|
||||
|
||||
# proxy settings
|
||||
proxy_enabled = config["PROXY"]["proxy_enabled"] == "True"
|
||||
proxy_address = config["PROXY"]["url"]
|
||||
proxy_port = config["PROXY"]["port"]
|
||||
|
||||
# MySQL settings
|
||||
sql_enabled = config["SQL"]["sql_enabled"] == "True"
|
||||
sql_usr = config["SQL"]["usr"]
|
||||
sql_pwd = config["SQL"]["pwd"]
|
||||
sql_host = config["SQL"]["host"]
|
||||
sql_database = config["SQL"]["database"]
|
||||
|
||||
# Other seetings
|
||||
IPV6_CHECKED = config["OTHER"]["ipv6"]
|
||||
CLAIM_AMAZON = config["OTHER"]["claim_amazon"] == "True"
|
||||
|
||||
|
||||
g = open(MotPath, "r", encoding="utf-8")
|
||||
lines = g.readlines()
|
||||
if len(lines) < 3 :
|
||||
Liste_de_mot = list(lines[0].split(","))
|
||||
else :
|
||||
Liste_de_mot = [x.replace('\n', "") for x in lines]
|
||||
g.close()
|
||||
|
||||
|
||||
with open(CREDENTIALS_PATH) as f:
|
||||
reader = reader(f)
|
||||
Credentials = list(reader)
|
||||
shuffle(Credentials)
|
||||
|
|
|
@ -1,66 +1,67 @@
|
|||
import sqlite3
|
||||
import mysql.connector
|
||||
|
||||
|
||||
# Create a new row, for the account [compte] whith [points] points
|
||||
def add_row(account, points, mycursor, mydb):
|
||||
sql = "INSERT INTO daily (compte, points, date) VALUES (?, ?, date())"
|
||||
val = (account, points)
|
||||
def add_row(compte, points, mycursor, mydb):
|
||||
sql = "INSERT INTO daily (compte, points, date) VALUES (%s, %s, current_date())"
|
||||
val = (compte, points)
|
||||
mycursor.execute(sql, val)
|
||||
mydb.commit()
|
||||
#printf(mycursor.rowcount, "record created.")
|
||||
|
||||
|
||||
# update the ammount of points for the account [compte]
|
||||
def update_row(account, points, mycursor, mydb):
|
||||
sql = f"UPDATE daily SET points = {points} WHERE compte = '{account}' AND date = date() ;"
|
||||
def update_row(compte, points, mycursor, mydb):
|
||||
sql = f"UPDATE daily SET points = {points} WHERE compte = '{compte}' AND date = current_date() ;"
|
||||
mycursor.execute(sql)
|
||||
mydb.commit()
|
||||
#printf(mycursor.rowcount, "record(s) updated")
|
||||
|
||||
|
||||
# update the value of last_pts for the table comptes
|
||||
def update_last(account, points, mycursor, mydb):
|
||||
sql1 = f"UPDATE comptes SET last_pts = {points} WHERE compte = '{account}';"
|
||||
sql2 = f"select * from comptes where compte = '{account}'"
|
||||
sql3 = f"INSERT INTO comptes (compte, last_pts,banned) VALUES ('{account}', {points}, 0)"
|
||||
cmd = mycursor.execute(sql2)
|
||||
if len(list(cmd)) == 0:
|
||||
mycursor.execute(sql3)
|
||||
else:
|
||||
mycursor.execute(sql1)
|
||||
def update_last(compte, points, mycursor, mydb):
|
||||
sql = f"UPDATE comptes SET last_pts = {points} WHERE compte = '{compte}';"
|
||||
mycursor.execute(sql)
|
||||
mydb.commit()
|
||||
#printf(mycursor.rowcount, "record(s) updated")
|
||||
|
||||
|
||||
# Return if there already is a line in the database for the account [account].
|
||||
# if same_point is enabled, the line must also have the same number of points
|
||||
# SQLITE
|
||||
def get_row(account, points, mycursor, same_points=True):
|
||||
def get_row(compte, points, mycursor, same_points = True): #return if there is a line with the same ammount of point or with the same name as well as the same day
|
||||
if same_points :
|
||||
mycursor.execute(f"SELECT * FROM daily WHERE points = {points} AND compte = '{account}' AND date = date() ;")
|
||||
mycursor.execute(f"SELECT * FROM daily WHERE points = {points} AND compte = '{compte}' AND date = current_date() ;")
|
||||
else :
|
||||
mycursor.execute(f"SELECT * FROM daily WHERE compte = '{account}' AND date = date() ;")
|
||||
mycursor.execute(f"SELECT * FROM daily WHERE compte = '{compte}' AND date = current_date() ;")
|
||||
myresult = mycursor.fetchall()
|
||||
return(len(myresult) == 1)
|
||||
|
||||
|
||||
def add_to_database(account, points):
|
||||
if points is None:
|
||||
pass
|
||||
else:
|
||||
mydb = sqlite3.connect("/app/MsRewards-Reborn/MsRewards.db")
|
||||
def add_to_database(compte, points, sql_host,sql_usr,sql_pwd,sql_database, save_if_fail=True):
|
||||
try:
|
||||
mydb = mysql.connector.connect(
|
||||
host=sql_host,
|
||||
user=sql_usr,
|
||||
password=sql_pwd,
|
||||
database = sql_database
|
||||
)
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
if get_row(account, points, mycursor, True):
|
||||
# check if the row exist with the same amount of points and do nothing if it does
|
||||
if get_row(compte, points,mycursor, True): #check if the row exist with the same ammount of points and do nothind if it does
|
||||
#printf("les points sont deja bon")
|
||||
#return(0)
|
||||
pass
|
||||
|
||||
# check if the row exist, but without the same amount of points and update the point account then
|
||||
elif get_row(account, points, mycursor, False):
|
||||
update_row(account, points, mycursor, mydb)
|
||||
|
||||
else: # if the row don't exist, create it with the good amount of points
|
||||
add_row(account, points, mycursor, mydb)
|
||||
|
||||
elif get_row(compte, points,mycursor, False) : #check if the row exist, but without the same ammount of points and update the point account then
|
||||
update_row(compte, points,mycursor,mydb)
|
||||
#printf("row updated")
|
||||
#return(1)
|
||||
else : # if the row don't exist, create it with the good ammount of points
|
||||
add_row(compte, points,mycursor,mydb)
|
||||
#return(2) #printf("row added")
|
||||
if int(points) > 10 :
|
||||
update_last(account, points, mycursor, mydb)
|
||||
update_last(compte, points, mycursor, mydb)
|
||||
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
except BaseException as e:
|
||||
if save_if_fail:
|
||||
print("\nLes points n'ont pas pu être ajoutés, enregistrement dans le fichier 'points.csv'\n")
|
||||
with open("points.csv", "a") as file:
|
||||
file.write(f"{compte},{points}\n")
|
||||
raise e
|
||||
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
import os
|
||||
import json
|
||||
from random import uniform
|
||||
|
||||
from selenium.common import TimeoutException
|
||||
from selenium.webdriver import ActionChains, Keys
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.support import expected_conditions
|
||||
from selenium.webdriver.support.wait import WebDriverWait
|
||||
|
||||
from modules.Tools.logger import debug
|
||||
from modules.Tools.tools import *
|
||||
|
||||
|
||||
def init_profile(mail, mobile=False):
|
||||
if not mobile:
|
||||
chrome_profile_dir = "/app/MsRewards-Reborn/user_data/profile/"+mail
|
||||
else:
|
||||
chrome_profile_dir = "/app/MsRewards-Reborn/user_data/profile/mobile-"+mail
|
||||
|
||||
os.makedirs(chrome_profile_dir, exist_ok=True)
|
||||
|
||||
preferences_file = os.path.join(chrome_profile_dir, "Default", "Preferences")
|
||||
if not os.path.exists(preferences_file):
|
||||
os.makedirs(os.path.join(chrome_profile_dir, "Default"), exist_ok=True)
|
||||
with open(preferences_file, "w") as f:
|
||||
json.dump(
|
||||
{
|
||||
"intl": {
|
||||
"accept_languages": "fr-FR,en-US,en",
|
||||
"selected_languages": "fr-FR,en-US,en"
|
||||
}
|
||||
}, f
|
||||
)
|
||||
else:
|
||||
with open(preferences_file, "r") as f:
|
||||
settings = json.load(f)
|
||||
|
||||
if "intl" not in settings:
|
||||
settings["intl"] = {}
|
||||
|
||||
settings["intl"]["accept_languages"] = "fr-FR,en-US,en"
|
||||
settings["intl"]["selected_languages"] = "fr-FR,en-US,en"
|
||||
|
||||
with open(preferences_file, "w") as f:
|
||||
json.dump(settings, f)
|
||||
|
||||
return chrome_profile_dir
|
||||
|
||||
|
||||
# Deal with RGPD popup as well as some random popup like 'are you satisfied' one
|
||||
def rgpd_popup(config) -> None:
|
||||
for i in ["bnp_btn_accept", "bnp_hfly_cta2", "bnp_hfly_close"]:
|
||||
try:
|
||||
config.WebDriver.driver.find_element(By.ID, i).click()
|
||||
except Exception as err:
|
||||
debug(err)
|
||||
|
||||
|
||||
"""
|
||||
send_keys_wait([selenium element:element, str:keys]) send the different keys to the field element, with a random
|
||||
time between each press to simulate human action.
|
||||
keys can be an string, but also selenium keys
|
||||
"""
|
||||
|
||||
|
||||
def send_keys_wait(element, keys: str) -> None:
|
||||
for i in keys:
|
||||
element.send_keys(i)
|
||||
sleep(uniform(0.1, 0.3))
|
||||
|
||||
def send_wait_and_confirm(element, keys: str) -> None:
|
||||
send_keys_wait(element, keys)
|
||||
element.send_keys(Keys.ENTER)
|
||||
|
||||
|
||||
# Wait for the presence of the element identifier or [timeout]s
|
||||
def wait_until_visible(search_by: str, identifier: str, timeout: int = 20, browser=None, raise_error=True) -> bool:
|
||||
try:
|
||||
WebDriverWait(browser, timeout).until(
|
||||
expected_conditions.visibility_of_element_located((search_by, identifier)), "element not found")
|
||||
return True
|
||||
except TimeoutException as e:
|
||||
if raise_error:
|
||||
error(f"element {identifier} not found after {timeout}s")
|
||||
return False
|
|
@ -1,10 +1,7 @@
|
|||
from selenium.common.exceptions import TimeoutException, NoSuchElementException, ElementClickInterceptedException
|
||||
|
||||
class Banned(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class NotBanned(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class Identity(Exception):
|
||||
pass
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
import argparse
|
||||
import asyncio
|
||||
import json
|
||||
import configparser
|
||||
import pickle
|
||||
from csv import reader
|
||||
from datetime import datetime, timedelta
|
||||
from os import path, sys, system
|
||||
from random import choice, randint, shuffle, uniform
|
||||
from re import findall, search
|
||||
from sys import platform
|
||||
from time import sleep, time
|
||||
|
||||
from discord import Colour, Embed, File, RequestsWebhookAdapter, Webhook
|
||||
from pyotp import TOTP
|
||||
from pyvirtualdisplay import Display
|
||||
from pyvirtualdisplay.smartdisplay import SmartDisplay
|
||||
from requests import get
|
||||
from selenium import webdriver
|
||||
from selenium.common import exceptions
|
||||
from selenium.common.exceptions import (ElementClickInterceptedException,
|
||||
NoSuchElementException,
|
||||
StaleElementReferenceException,
|
||||
TimeoutException, WebDriverException)
|
||||
from selenium.webdriver import ActionChains
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.common.keys import Keys
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
from selenium.webdriver.support.ui import Select, WebDriverWait
|
||||
from ast import literal_eval
|
||||
try:
|
||||
import enquiries
|
||||
except:
|
||||
system("") # enable colors in windows cmd
|
||||
import undetected_chromedriver as uc
|
|
@ -0,0 +1,32 @@
|
|||
#add return a string witx tabs
|
||||
def tabs(x):
|
||||
return(x*4*" ")
|
||||
|
||||
|
||||
#create dictionnary with all progress bars
|
||||
def dico(progress):
|
||||
dico_task = {
|
||||
"daily" : {
|
||||
"all" : progress.add_task("[yellow]daily", total=100, start=False, visible=False),
|
||||
"carte0" : progress.add_task(f"[yellow]{tabs(1)}carte 1", total=100, start=False, visible = False),
|
||||
"carte1" : progress.add_task(f"[yellow]{tabs(1)}carte 2", total=100, start=False, visible = False),
|
||||
"carte2" : progress.add_task(f"[yellow]{tabs(1)}carte 3", total=100, start=False, visible = False)
|
||||
},
|
||||
"weekly" : {
|
||||
"all" : progress.add_task("[yellow]weekly", total=100, start=False, visible=False),
|
||||
"carte1" : progress.add_task(f"[yellow]{tabs(1)}carte 1", total=100, start=False, visible = False),
|
||||
"carte2" : progress.add_task(f"[yellow]{tabs(1)}carte 2", total=100, start=False, visible = False),
|
||||
"carte3" : progress.add_task(f"[yellow]{tabs(1)}carte 3", total=100, start=False, visible = False),
|
||||
"carte3" : progress.add_task(f"[yellow]{tabs(1)}carte 4", total=100, start=False, visible = False),
|
||||
"carte3" : progress.add_task(f"[yellow]{tabs(1)}carte 5", total=100, start=False, visible = False),
|
||||
"carte3" : progress.add_task(f"[yellow]{tabs(1)}carte 6", total=100, start=False, visible = False),
|
||||
"carte3" : progress.add_task(f"[yellow]{tabs(1)}carte 7", total=100, start=False, visible = False),
|
||||
"carte3" : progress.add_task(f"[yellow]{tabs(1)}carte 8", total=100, start=False, visible = False),
|
||||
"carte3" : progress.add_task(f"[yellow]{tabs(1)}carte 9", total=100, start=False, visible = False),
|
||||
},
|
||||
"PC" : progress.add_task(f"[yellow]PC", total=100, start=False, visible = False),
|
||||
"Mobile" : progress.add_task(f"[yellow]Mobile", total=100, start=False, visible = False),
|
||||
|
||||
|
||||
}
|
||||
return(dico_task)
|
|
@ -0,0 +1,106 @@
|
|||
from time import sleep
|
||||
from datetime import timedelta
|
||||
from random import uniform
|
||||
import discord
|
||||
from discord import ( # Importing discord.Webhook and discord.RequestsWebhookAdapter
|
||||
Colour,
|
||||
Webhook,
|
||||
)
|
||||
|
||||
from modules.config import *
|
||||
|
||||
"""
|
||||
send_keys_wait([selenium element:element, str:keys]) send the different keys to the field element, with a random time between each press to simulate human action.
|
||||
keys can be an string, but alos selenium keys
|
||||
"""
|
||||
def send_keys_wait(element, keys):
|
||||
for i in keys:
|
||||
element.send_keys(i)
|
||||
if FAST :
|
||||
pass
|
||||
else :
|
||||
sleep(uniform(0.1, 0.3))
|
||||
|
||||
|
||||
def LogError(message, driver, mail, log=FULL_LOG):
|
||||
print(f"\n\n\033[93m Erreur : {str(message)} \033[0m\n\n")
|
||||
if DISCORD_ENABLED_ERROR:
|
||||
with open("page.html", "w") as f:
|
||||
f.write(driver.page_source)
|
||||
|
||||
driver.save_screenshot("screenshot.png")
|
||||
if not log:
|
||||
embed = discord.Embed(
|
||||
title="An Error has occured",
|
||||
description=str(message),
|
||||
colour=Colour.red(),
|
||||
)
|
||||
else:
|
||||
embed = discord.Embed(
|
||||
title="Full log is enabled",
|
||||
description=str(message),
|
||||
colour=Colour.blue(),
|
||||
)
|
||||
|
||||
file = discord.File("screenshot.png")
|
||||
embed.set_image(url="attachment://screenshot.png")
|
||||
embed.set_footer(text=mail)
|
||||
webhookFailure.send(embed=embed, file=file)
|
||||
webhookFailure.send(file=discord.File("page.html"))
|
||||
|
||||
|
||||
|
||||
# add the time arround the text given in [text]
|
||||
# [text] : string
|
||||
def Timer(text, mail):
|
||||
return(f"[{mail} - {timedelta(seconds = round(float(time() - START_TIME)))}] " + str(text))
|
||||
|
||||
|
||||
# replace the function print, with more options
|
||||
# [txt] : string, [driver] : selenium wbdriver
|
||||
def printf2(txt, mail, LOG = LOG):
|
||||
if LOG:
|
||||
print(Timer(txt, mail))
|
||||
|
||||
|
||||
|
||||
# check if the user is using IPV4 using ipify.org
|
||||
# [driver] : selenium webdriver
|
||||
|
||||
def check_ipv4(driver):
|
||||
driver.get("https://api64.ipify.org")
|
||||
elm = driver.find_element(By.TAG_NAME, "body")
|
||||
if len(elm.text.split('.')) == 4 :
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
|
||||
def CustomSleep(temps):
|
||||
try :
|
||||
if FAST and temps > 50:
|
||||
sleep(temps/10)
|
||||
return()
|
||||
if not LOG or not LINUX_HOST: #only print sleep when user see it
|
||||
points = ["⢿", "⣻", "⣽", "⣾", "⣷", "⣯", "⣟", "⡿"]
|
||||
passe = 0
|
||||
for i in range(int(temps)):
|
||||
for i in range(8):
|
||||
sleep(0.125)
|
||||
passe += 0.125
|
||||
print(f"{points[i]} - {round(float(temps) - passe, 3)}", end="\r")
|
||||
print(" ", end="\r")
|
||||
else:
|
||||
sleep(temps)
|
||||
except KeyboardInterrupt :
|
||||
print("attente annulée")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def progressBar(current, total=30, barLength=20, name="Progress"):
|
||||
percent = float(current + 1) * 100 / total
|
||||
arrow = "-" * int(percent / 100 * barLength - 1) + ">"
|
||||
spaces = " " * (barLength - len(arrow))
|
||||
print(name + ": [%s%s] %d %%" % (arrow, spaces, percent), end="\r")
|
|
@ -1,17 +1,6 @@
|
|||
mysql-connector-python
|
||||
argparse
|
||||
discord.py==1.7.3
|
||||
selenium
|
||||
pillow
|
||||
pyvirtualdisplay
|
||||
undetected_chromedriver
|
||||
requests>=2.31.0
|
||||
flask
|
||||
flask_sse
|
||||
EasyProcess
|
||||
pyotp
|
||||
packaging
|
||||
apscheduler
|
||||
flask_login
|
||||
gunicorn
|
||||
gevent
|
||||
redis
|
||||
enquiries
|
||||
rich
|
3
sse.sh
3
sse.sh
|
@ -1,3 +0,0 @@
|
|||
while IFS= read -r newline; do
|
||||
redis-cli publish console "$newline"
|
||||
done < <(tail -f /app/MsRewards-Reborn/Flask/static/logs/custom.txt)
|
|
@ -1,4 +0,0 @@
|
|||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
|
@ -0,0 +1,36 @@
|
|||
[PATH]
|
||||
|
||||
motpath = /usr/share/dict/french
|
||||
logpath = /your/path/to/loginandpass.csv
|
||||
|
||||
[SETTINGS]
|
||||
|
||||
FidelityLink = Null
|
||||
embeds = False
|
||||
Headless = True
|
||||
|
||||
[DISCORD]
|
||||
|
||||
DiscordErrorEnabled = True
|
||||
DiscordSuccessEnabled = True
|
||||
successlink = https://discord.com/api/webhooks/[put your webhook here]
|
||||
errorlink =https://discord.com/api/webhooks/[put your webhook here]
|
||||
|
||||
[PROXY]
|
||||
|
||||
proxy_enabled = False
|
||||
url = Null
|
||||
port = 0
|
||||
|
||||
[SQL]
|
||||
|
||||
sql_enabled = False
|
||||
host = Null
|
||||
database = MsRewards
|
||||
usr = root
|
||||
pwd = password
|
||||
|
||||
[OTHER]
|
||||
|
||||
ipv6 = False
|
||||
claim_amazon = False
|
|
@ -1 +0,0 @@
|
|||
{}
|
|
@ -1,4 +0,0 @@
|
|||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
|
@ -1 +0,0 @@
|
|||
{}
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"password": "ChangeMe",
|
||||
"secret": ""
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
*
|
|
@ -1 +0,0 @@
|
|||
{}
|
|
@ -1 +0,0 @@
|
|||
{"avatarlink":"https://cdn.discordapp.com/icons/793934298977009674/d8055bccef6eca4855c349e808d0d788.webp"}
|
Loading…
Reference in New Issue