The crux.sexy website
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 

39 рядки
913 B

  1. from flask import Flask, render_template, redirect, request
  2. from time import time
  3. from urllib.parse import urlparse
  4. app = Flask(
  5. __name__,
  6. static_url_path='',
  7. static_folder='static/',
  8. template_folder='templates/'
  9. )
  10. @app.route('/')
  11. def index():
  12. return render_template("index.html")
  13. @app.route('/agegate')
  14. def agegate():
  15. url = request.args.get("to", default="/")
  16. return render_template("age-gate.html", url=url)
  17. @app.route('/accept')
  18. def accept():
  19. url = request.args.get("url", default=None)
  20. print(urlparse(url).netloc)
  21. if urlparse(url).netloc and urlparse(url).netloc[-9:] != "crux.sexy":
  22. print("oops")
  23. url = "/"
  24. if not url:
  25. url = "/"
  26. res = redirect(url, 307)
  27. res.set_cookie("agegate", "true", time() + 60*60*24*365, domain="crux.sexy")
  28. return res
  29. if __name__ == "__main__":
  30. app.run(debug=True, host='0.0.0.0', port=5002)