From e21ee8b5a464b9122b41e4ffbcaace0517dd47a6 Mon Sep 17 00:00:00 2001 From: piair Date: Sat, 30 Sep 2023 17:23:37 +0200 Subject: [PATCH] =?UTF-8?q?faire=20git=20pull=20=3D=20=C3=AAtre=20un=20gro?= =?UTF-8?q?s=20fou,=20j'ai=20rien=20tester?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Flask/app.py | 4 +++- Flask/templates/vnc_get.html | 2 +- V6.py | 43 ++++++++++++++++++++++++++++++++++++ modules/config.py | 26 +++++++++++++++++----- version | 2 +- 5 files changed, 68 insertions(+), 9 deletions(-) diff --git a/Flask/app.py b/Flask/app.py index 2b46fce..567f9e1 100644 --- a/Flask/app.py +++ b/Flask/app.py @@ -372,7 +372,9 @@ def stats(): @app.route("/override/", methods=["POST"]) def override_post(): json = request.form.to_dict(flat=False) - print(request.form["unban"]) + log = open(f"/app/MsRewards-Reborn/Flask/static/logs/custom.txt", 'w') # so that data written to it will be appended + subprocess.Popen([f"python3 -u /app/MsRewards-Reborn/V6.py -c {json['config']} --very-custom {json}"], stdout=log, stderr=log, shell=True) + log.close() return(render_template("vnc_post.html")) @app.route("/override/", methods=["GET"]) diff --git a/Flask/templates/vnc_get.html b/Flask/templates/vnc_get.html index c918387..a1753f4 100644 --- a/Flask/templates/vnc_get.html +++ b/Flask/templates/vnc_get.html @@ -37,9 +37,9 @@ function change_override(value, data) { + - {% endfor %} diff --git a/V6.py b/V6.py index a8d4977..0ad1edb 100755 --- a/V6.py +++ b/V6.py @@ -823,7 +823,50 @@ def CustomStart(): printf(f"CustomStart {e}") driver.quit() +def very_custom_start(json): + display = SmartDisplay(backend="xvnc", size=(1920, 1080), rfbport=2345, color_depth=24) + display.start() + config = int(json[config]) + # definir cred + for i in range(5): + g._mail = cred[0] + g._password = cred[1] + for j in ["unban", "tout", "pc", "mobile", "log_points"]: + if str(i) in json[j]: + start = True + + if start: + driver = firefox_driver() + if str(i) in json["unban"]: + pwd_login(driver) # TODO : define only the first part of login + else : + login(driver) + if str(i) in json["tout"]: + daily_routine(True) + else : + if str(i) in json["daily"]: + try: + bing_pc_search() + except Exception as e: + log_error(e) + if str(i) in json["pc"]: + try: + bing_pc_search() + except Exception as e: + log_error(e) + if str(i) in json["mobile"]: + try: + bing_mobile_search() + except Exception as e: + log_error(e) + try: + log_points(g._mail) + except Exception as e: + printf(f"CustomStart {e}") + + driver.close() + display.stop() if g.vnc_enabled or g.dev: display = SmartDisplay(backend="xvnc", size=(1920, 1080), rfbport=g.vnc_port, color_depth=24) else : diff --git a/modules/config.py b/modules/config.py index 2f2293d..a508cf1 100644 --- a/modules/config.py +++ b/modules/config.py @@ -4,6 +4,10 @@ from modules.imports import * import modules.globals as g import json +class FakeWebHook: + def send(self, text = "", username='', avatar_url='', embed = "", file =""): + print(text) + parser = argparse.ArgumentParser() parser.add_argument( @@ -62,6 +66,12 @@ parser.add_argument( default="None" ) +parser.add_argument( + "--very-custom", + help="Choose a specific config file", + default="" +) + 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: @@ -78,6 +88,8 @@ g.custom_start = args.override g.unban = args.unban g.full_log = args.fulllog g.dev = args.dev +g.very_custom = args.very_custom + if g.custom_start : g.log = True @@ -104,12 +116,14 @@ g.discord_enabled_success = discord[discord_conf]["successT"] == "True" g.avatar_url = settings["avatarlink"] - -if g.discord_enabled_error: - webhookFailure = Webhook.from_url(g.discord_error_link, adapter=RequestsWebhookAdapter()) -if g.discord_enabled_success: - webhookSuccess = Webhook.from_url(g.discord_success_link, adapter=RequestsWebhookAdapter()) - +if not very_custom : + if g.discord_enabled_error: + webhookFailure = Webhook.from_url(g.discord_error_link, adapter=RequestsWebhookAdapter()) + if g.discord_enabled_success: + webhookSuccess = Webhook.from_url(g.discord_success_link, adapter=RequestsWebhookAdapter()) +else : + webhookFailure = FakeWebHook() + webhookSuccess = FakeWebHook() # base settings g.discord_embed = False # send new point value in an embed, fixed for now g.headless = False diff --git a/version b/version index ddaa0dd..665584b 100644 --- a/version +++ b/version @@ -1 +1 @@ -v6.6.26 +v6.6.27