Spaces:
Sleeping
Sleeping
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 | |
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/FUNCTIONS_BACKEND.txt', 'r', encoding='utf-8') | |
FCODE = f.read() | |
f.close() | |
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) |