mirror of
				https://gitea.augustin64.fr/piair/MsRewards-Reborn.git
				synced 2025-11-04 07:33:53 +01:00 
			
		
		
		
	faire git pull = être un gros fou, j'ai rien tester
This commit is contained in:
		@@ -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"])
 | 
			
		||||
 
 | 
			
		||||
@@ -37,9 +37,9 @@ function change_override(value, data) {
 | 
			
		||||
            <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="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="mobile"></td>
 | 
			
		||||
            <td><input type="checkbox" id="compte_{{i}}" value="{{i}}" name="log_points"></td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
        
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										43
									
								
								V6.py
									
									
									
									
									
								
							
							
						
						
									
										43
									
								
								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 :
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user