-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
37 lines (29 loc) · 825 Bytes
/
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,url_for,redirect,render_template
from lib.on import get_price
from functools import wraps
import os
app = Flask(__name__)
def link_verify(func):
@wraps(func)
def verfication():
get = os.popen('cat /var/lib/tor/hidden_service/hostname')
out = get.read().replace('\n','')
if request.host == out:
return func()
else:
return 'It works'
return verfication
@app.route('/link')
def get_link():
get = os.popen('cat /var/lib/tor/hidden_service/hostname')
out = get.read()
return out
@app.route('/')
@link_verify
def home():
return render_template('price.html',price=get_price())
@app.route('/<path:st>')
def not_found(st):
return redirect(url_for('home'))
if __name__ == '__main__':
app.run(port=5000)