faire git pull = être un gros fou, j'ai rien tester
This commit is contained in:
parent
92ee7da9a4
commit
e21ee8b5a4
|
@ -372,7 +372,9 @@ def stats():
|
||||||
@app.route("/override/", methods=["POST"])
|
@app.route("/override/", methods=["POST"])
|
||||||
def override_post():
|
def override_post():
|
||||||
json = request.form.to_dict(flat=False)
|
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"))
|
return(render_template("vnc_post.html"))
|
||||||
|
|
||||||
@app.route("/override/", methods=["GET"])
|
@app.route("/override/", methods=["GET"])
|
||||||
|
|
|
@ -37,9 +37,9 @@ function change_override(value, data) {
|
||||||
<td id="compte_{{i}}"></td>
|
<td id="compte_{{i}}"></td>
|
||||||
<td><input type="checkbox" id="compte_{{i}}" value="{{i}}" name="unban"></td>
|
<td><input type="checkbox" id="compte_{{i}}" value="{{i}}" name="unban"></td>
|
||||||
<td><input type="checkbox" id="compte_{{i}}" value="{{i}}" name="tout"></td>
|
<td><input type="checkbox" id="compte_{{i}}" value="{{i}}" name="tout"></td>
|
||||||
|
<td><input type="checkbox" id="compte_{{i}}" value="{{i}}" name="daily"></td>
|
||||||
<td><input type="checkbox" id="compte_{{i}}" value="{{i}}" name="pc"></td>
|
<td><input type="checkbox" id="compte_{{i}}" value="{{i}}" name="pc"></td>
|
||||||
<td><input type="checkbox" id="compte_{{i}}" value="{{i}}" name="mobile"></td>
|
<td><input type="checkbox" id="compte_{{i}}" value="{{i}}" name="mobile"></td>
|
||||||
<td><input type="checkbox" id="compte_{{i}}" value="{{i}}" name="log_points"></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
43
V6.py
43
V6.py
|
@ -823,7 +823,50 @@ def CustomStart():
|
||||||
printf(f"CustomStart {e}")
|
printf(f"CustomStart {e}")
|
||||||
driver.quit()
|
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:
|
if g.vnc_enabled or g.dev:
|
||||||
display = SmartDisplay(backend="xvnc", size=(1920, 1080), rfbport=g.vnc_port, color_depth=24)
|
display = SmartDisplay(backend="xvnc", size=(1920, 1080), rfbport=g.vnc_port, color_depth=24)
|
||||||
else :
|
else :
|
||||||
|
|
|
@ -4,6 +4,10 @@ from modules.imports import *
|
||||||
import modules.globals as g
|
import modules.globals as g
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
class FakeWebHook:
|
||||||
|
def send(self, text = "", username='', avatar_url='', embed = "", file =""):
|
||||||
|
print(text)
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
@ -62,6 +66,12 @@ parser.add_argument(
|
||||||
default="None"
|
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:
|
with open("/app/MsRewards-Reborn/user_data/discord.json", "r") as inFile:
|
||||||
discord = json.load(inFile)
|
discord = json.load(inFile)
|
||||||
with open("/app/MsRewards-Reborn/user_data/settings.json", "r") as 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.unban = args.unban
|
||||||
g.full_log = args.fulllog
|
g.full_log = args.fulllog
|
||||||
g.dev = args.dev
|
g.dev = args.dev
|
||||||
|
g.very_custom = args.very_custom
|
||||||
|
|
||||||
if g.custom_start :
|
if g.custom_start :
|
||||||
g.log = True
|
g.log = True
|
||||||
|
|
||||||
|
@ -104,12 +116,14 @@ g.discord_enabled_success = discord[discord_conf]["successT"] == "True"
|
||||||
|
|
||||||
g.avatar_url = settings["avatarlink"]
|
g.avatar_url = settings["avatarlink"]
|
||||||
|
|
||||||
|
if not very_custom :
|
||||||
if g.discord_enabled_error:
|
if g.discord_enabled_error:
|
||||||
webhookFailure = Webhook.from_url(g.discord_error_link, adapter=RequestsWebhookAdapter())
|
webhookFailure = Webhook.from_url(g.discord_error_link, adapter=RequestsWebhookAdapter())
|
||||||
if g.discord_enabled_success:
|
if g.discord_enabled_success:
|
||||||
webhookSuccess = Webhook.from_url(g.discord_success_link, adapter=RequestsWebhookAdapter())
|
webhookSuccess = Webhook.from_url(g.discord_success_link, adapter=RequestsWebhookAdapter())
|
||||||
|
else :
|
||||||
|
webhookFailure = FakeWebHook()
|
||||||
|
webhookSuccess = FakeWebHook()
|
||||||
# base settings
|
# base settings
|
||||||
g.discord_embed = False # send new point value in an embed, fixed for now
|
g.discord_embed = False # send new point value in an embed, fixed for now
|
||||||
g.headless = False
|
g.headless = False
|
||||||
|
|
Loading…
Reference in New Issue