thewellermangroup's picture
Update app.py
f102b09
raw
history blame
4.03 kB
import flask
import flask_cors
import os
def checkPassword(passwordInput, password):
if (str(passwordInput) == str(password)):
return True
else:
return False
# sets up the app
app = flask.Flask(__name__)
flask_cors.CORS(app)
# creates a API endpoint for the password input
@app.route('/api/thewellermangroup/passwordinput/<passwordIn>', methods=['GET'])
def password(passwordIn):
PASSWORD = "1234"
securePassword = "$"+PASSWORD
access = checkPassword(passwordIn, securePassword)
data = {}
# Example data (could be fetched or processed dynamically)
if access:
data = {
'PASSWORD': securePassword,
'PASSWORDINPUT': passwordIn,
'ACCESS': access,
'RIGHTCLICK':
'''
var contextMenu = document.querySelector(".wrapperfortheclick");
window.addEventListener("contextmenu", e => {
e.preventDefault();
let x = e.offsetX, y = e.offsetY,
winWidth = document.body.scrollWidth,
winHeight = document.body.scrollHeight,
cmWidth = contextMenu.offsetWidth,
cmHeight = contextMenu.offsetHeight;
x = x > winWidth - cmWidth ? winWidth - cmWidth : x;
y = y > winHeight - cmHeight ? winHeight - cmHeight : y;
contextMenu.style.left = `${x}px`;
contextMenu.style.top = `${y}px`;
contextMenu.style.visibility = "visible";
});
document.addEventListener("click", () => contextMenu.style.visibility = "hidden");
''',
'LINKS': {
'Listen to Wellerman': 'https://cdn.jsdelivr.net/gh/The-Wellerman-Group/v3@latest/assets/wellerman.mp3',
'Jacob Janzen\'s Website': 'https://jacobinathanialpeterson-thiswillgiveyoualotofmalware.static.hf.space',
'Make a Review': 'https://embed-v2.testimonial.to/c/the-wellerman-group-reviews/?theme=light',
'The Wellerman Group AI': 'https://thewellermangroup-the-wellerman-group-ai.hf.space/',
'Listen to Wellerman': '',
'Listen to Wellerman': '',
}
}
f = open("FUNCTIONS.txt",'r',encoding="utf-8")
functions0 = f.read()
f.close()
functions1 = functions0.split('\nfunction ')
functions1 = functions1[1:]
# print(functions1)
BACKEND = ""
FRONTEND = ""
num = 0
for fun in functions1:
n = fun.split('{', 1)[0].strip()
f = fun.split('{', 1)[1].rsplit('}', 1)[0].strip().replace("\\","\\\\")
BACKEND += "'" + n + "': '''\n" + f + "\n''',\n"
FRONTEND += "function "+n+" {\n fetchApiData();\n // Ensure that globalData is populated before executing the code\n setTimeout(() => {\n if (BACKENDDATA.ACCESS) {\n eval(BACKENDDATA.FUNCTIONS['"+n+"']);\n }\n }, DELAYTIME);\n}\n"
num += 1
# print(BACKEND)
# print(FRONTEND)
print(num)
f = open("./FUNCTIONS_BACKEND.txt",'w',encoding="utf-8")
f.write(BACKEND)
f.close()
f = open("./FUNCTIONS_FRONTEND.txt",'w',encoding="utf-8")
f.write(FRONTEND)
f.close()
f = open('./FUNCTIONS_BACKEND.txt', 'r', encoding='utf-8')
FCODE = f.read()
f.close()
print(FCODE)
exec("data.update({'FUNCTIONS': {"+FCODE+"}})")
else:
data = {
'PASSWORD': 'Access Denied',
'PASSWORDINPUT': passwordIn,
'ACCESS': access,
'RIGHTCLICK': 'Access Denied',
'FUNCTIONS': 'Access Denied'
}
return flask.jsonify(data)
if __name__ == "__main__":
app.run(debug=True,host="0.0.0.0",port=5000)