thewellermangroup commited on
Commit
ccdb867
1 Parent(s): 72d5439

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +74 -0
app.py ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import flask
2
+ import flask_cors
3
+ import os
4
+
5
+ def checkPassword(passwordInput, password):
6
+ if (str(passwordInput) == str(password)):
7
+ return True
8
+ else:
9
+ return False
10
+
11
+ # sets up the app
12
+ app = flask.Flask(__name__)
13
+ flask_cors.CORS(app)
14
+
15
+ # creates a API endpoint for the password input
16
+ @app.route('/api/thewellermangroup/passwordinput/<passwordIn>', methods=['GET'])
17
+ def password(passwordIn):
18
+ PASSWORD = "1234"
19
+ securePassword = "$"+PASSWORD
20
+ access = checkPassword(passwordIn, securePassword)
21
+ data = {}
22
+
23
+ # Example data (could be fetched or processed dynamically)
24
+
25
+ if access:
26
+ data = {
27
+ 'PASSWORD': securePassword,
28
+ 'PASSWORDINPUT': passwordIn,
29
+ 'ACCESS': access,
30
+ 'RIGHTCLICK':
31
+ '''
32
+ var contextMenu = document.querySelector(".wrapperfortheclick");
33
+ window.addEventListener("contextmenu", e => {
34
+ e.preventDefault();
35
+ let x = e.offsetX, y = e.offsetY,
36
+ winWidth = document.body.scrollWidth,
37
+ winHeight = document.body.scrollHeight,
38
+ cmWidth = contextMenu.offsetWidth,
39
+ cmHeight = contextMenu.offsetHeight;
40
+ x = x > winWidth - cmWidth ? winWidth - cmWidth : x;
41
+ y = y > winHeight - cmHeight ? winHeight - cmHeight : y;
42
+ contextMenu.style.left = `${x}px`;
43
+ contextMenu.style.top = `${y}px`;
44
+ contextMenu.style.visibility = "visible";
45
+ });
46
+ document.addEventListener("click", () => contextMenu.style.visibility = "hidden");
47
+ ''',
48
+ 'LINKS': {
49
+ 'Listen to Wellerman': 'https://cdn.jsdelivr.net/gh/The-Wellerman-Group/v3@latest/assets/wellerman.mp3',
50
+ 'Jacob Janzen\'s Website': 'https://jacobinathanialpeterson-thiswillgiveyoualotofmalware.static.hf.space',
51
+ 'Make a Review': 'https://embed-v2.testimonial.to/c/the-wellerman-group-reviews/?theme=light',
52
+ 'The Wellerman Group AI': 'https://thewellermangroup-the-wellerman-group-ai.hf.space/',
53
+ 'Listen to Wellerman': '',
54
+ 'Listen to Wellerman': '',
55
+
56
+ }
57
+ }
58
+ f = open('./FUNCTIONS/FUNCTIONS_BACKEND.txt', 'r', encoding='utf-8')
59
+ FCODE = f.read()
60
+ f.close()
61
+ exec("data.update({'FUNCTIONS': {"+FCODE+"}})")
62
+ else:
63
+ data = {
64
+ 'PASSWORD': 'Access Denied',
65
+ 'PASSWORDINPUT': passwordIn,
66
+ 'ACCESS': access,
67
+ 'RIGHTCLICK': 'Access Denied',
68
+ 'FUNCTIONS': 'Access Denied'
69
+ }
70
+
71
+ return flask.jsonify(data)
72
+
73
+ if __name__ == "__main__":
74
+ app.run(debug=True,host="0.0.0.0",port=5000)