from flask import Flask, redirect, render_template_string
import time
app = Flask(__name__)
# HTML template for the message page
message_template = """
Redirecting...
{{ message }}
{{ redirect_info }}
"""
@app.route('/')
def redirect_to_website():
time.sleep(3) # Delay in seconds before redirecting
message = "Redirecting you to our new AI experience! If not please click the link"
redirect_info = "You will be redirected shortly."
redirect_url = "https://ogegadavis254-roasting-2-0.hf.space"
# Render the HTML template with the message, redirect_info, and redirect_url
return render_template_string(message_template, message=message, redirect_info=redirect_info, redirect_url=redirect_url)
@app.route('/redirect')
def perform_redirect():
return redirect('https://ogegadavis254-roasting-2-0.hf.space')
if __name__ == '__main__':
app.run(debug=True)