-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
27 lines (21 loc) · 949 Bytes
/
__init__.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
import os, flask, pexpect, logging
app = flask.Flask(__name__)
@app.route("/", methods = ['GET'])
def input_page():
if(os.environ.get('WEBJUMPCUTTER_MONGO')!=None):
gdpr = 'This service stores anonymized usage data for statistics and research purposes and is compliant with General Data Protection Regulations'
else:
gdpr = 'This service does not store any information subject to General Data Protection Regulations'
return flask.render_template('main.html', gdpr=gdpr)
@app.route("/process", methods = ['POST'])
def output_page():
form_params = flask.request.form
video_file = flask.request.files['data_file']
file_content = video_file.stream.read().decode("utf-8")
result = process(file_content)
response = flask.make_response(result)
response.headers["Content-Disposition"] = "attachment; filename="+video_file.filename
return
def process():
if __name__ == '__main__':
app.run('0.0.0.0',8080)