The crux.sexy website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

43 lines
1022 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", nightly=False)
  13. @app.route('/nightly')
  14. def nightly():
  15. return render_template("index.html", nightly=True)
  16. @app.route('/agegate')
  17. def agegate():
  18. url = request.args.get("to", default="/")
  19. return render_template("age-gate.html", url=url)
  20. @app.route('/accept')
  21. def accept():
  22. url = request.args.get("url", default=None)
  23. print(urlparse(url).netloc)
  24. if urlparse(url).netloc and urlparse(url).netloc[-9:] != "crux.sexy":
  25. print("oops")
  26. url = "/"
  27. if not url:
  28. url = "/"
  29. res = redirect(url, 307)
  30. res.set_cookie("agegate", "true", time() + 60*60*24*365, domain="crux.sexy")
  31. return res
  32. if __name__ == "__main__":
  33. app.run(debug=True, host='0.0.0.0', port=5002)