Compare commits
No commits in common. "d381c5e113b3129d2de35cb535d2cc1c4101aeae" and "1e7f283e801e52e09e7bdc8e75ac15f6d8bc4031" have entirely different histories.
d381c5e113
...
1e7f283e80
30
Flask/app.py
30
Flask/app.py
@ -1,5 +1,3 @@
|
||||
import gevent.monkey
|
||||
gevent.monkey.patch_all()
|
||||
from time import sleep
|
||||
import subprocess
|
||||
import os
|
||||
@ -11,8 +9,6 @@ from werkzeug.utils import secure_filename
|
||||
import json
|
||||
import re
|
||||
from requests import get
|
||||
import redis
|
||||
|
||||
|
||||
# redis part for live update
|
||||
redis_client = redis.StrictRedis(host='localhost', port=6379, db=0)
|
||||
@ -20,13 +16,13 @@ pubsub = redis_client.pubsub()
|
||||
pubsub.subscribe('console')
|
||||
|
||||
def generate_output():
|
||||
try:
|
||||
for message in pubsub.listen():
|
||||
if message['type'] == 'message':
|
||||
yield f"data: {message['data'].decode()}\n\n"
|
||||
except redis.exceptions.ConnectionError as e:
|
||||
print(f"Error connecting to Redis: {e}")
|
||||
|
||||
@app.route('/stream')
|
||||
def stream():
|
||||
return Response(generate_output(), content_type='text/event-stream')
|
||||
# end
|
||||
|
||||
global password
|
||||
@ -146,11 +142,6 @@ class User(UserMixin):
|
||||
|
||||
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':
|
||||
@ -241,6 +232,21 @@ def discord_post():
|
||||
|
||||
@app.route("/dev/")
|
||||
def dev2():
|
||||
with open("/app/MsRewards-Reborn/user_data/proxy.json", "r") as inFile:
|
||||
j = json.load(inFile)
|
||||
new_proxy = {"address": "ADDRESS", "port": "PORT", "name":"NAME"}
|
||||
max_index = 0
|
||||
for i in range(1, 50):
|
||||
try :
|
||||
print(j[str(i)])
|
||||
except :
|
||||
print(f"found {i - 1} proxys")
|
||||
max_index = i
|
||||
break
|
||||
j[f"{max_index}"] = new_proxy
|
||||
print(j)
|
||||
with open("/app/MsRewards-Reborn/user_data/proxy.json", "w") as outfile:
|
||||
json.dump(j, outfile)
|
||||
return(render_template("dev.html"))
|
||||
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
const eventSource = new EventSource('/stream');
|
||||
|
||||
eventSource.onmessage = (event) => {
|
||||
console.log("etqhbbqetbqedrtqberzegr");
|
||||
const newOutput = document.createElement('div');
|
||||
newOutput.textContent = event.data;
|
||||
consoleElement.appendChild(newOutput);
|
||||
|
Loading…
Reference in New Issue
Block a user