@Zertyazertyu/

Server:0

Python

No description

fork
loading
Files
  • main.py
  • functions.py
  • requirements.txt
  • text.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from flask import Flask,request
from threading import Thread
from time import strftime
from functions import*
import json
import os


app = Flask('')
@app.route('/',methods = ['GET','POST'])
def home():
  if request.method=="GET":
    return """<html><head></head><body style="margin: 0px;padding:0px;"><iframe frameborder="0" width="100%" height="100%" src="https://CLIENTSHEYE.zertyazertyu.repl.run"></iframe></body></html>"""
  if request.method == 'POST':
      username = request.form['username']
      password = request.form['password']
      path = request.form['path']
      with open("text.txt",'a') as f:
        f.write(strftime("%d/%m/%y %H:%M")+"  "+username+": "+path+"\n")
        f.close()
      if os.getenv(username+'_PASSWORD') == password:
        rank = int(os.getenv(username+"_RANK"))
        return json.dumps({"validation":True,"data":getpath(path,rank),"path":path})
      else:return json.dumps({"validation":False})





def run():
  app.run(host='0.0.0.0',port=12345)
def keep_alive():  
    t = Thread(target=run)
    t.start()


keep_alive()