CoolFace
Apppublic

lain-iwakura/lainchan-proxy

sourceHugging Faceupdated 3y agoView on Hugging Face
3likes
fallback.py61 linesDownload Raw Back to root
1from flask import Flask, Response, jsonify2from flask_cors import CORS3 4port = 78605host = "0.0.0.0"6 7app = Flask(__name__)8CORS(app)9 10@app.route('/', defaults={'path': ''})11@app.route('/<path:path>', methods=['GET', 'POST'])12def catch_all(path):13    # HTML content14    html = '''<!DOCTYPE html>15<html lang="en">16  <head>17    <meta charset="UTF-8">18    <meta name="viewport" content="width=device-width, initial-scale=1.0">19    <title>Under maintenance</title>20    <style>21      body {22        background-color: #f5f5f5;23        color: #333;24        font-family: Arial, sans-serif;25        line-height: 1.5;26        padding: 1em;27        max-width: 800px;28        margin: 0 auto29      }30 31      h1,32      h2,33      h3,34      h4,35      h5,36      h6 {37        font-weight: bold;38        margin-top: 1.5em39      }40    </style>41  </head>42  <body>43    <h1>A note from us</h1>44	<hr>45    <p>Hello, discord users and redditors. An inside man from the janitorai discord told me that you were using my proxy.</p>46	<p>Stop using these proxies. Most, if not all of the proxies you use are made by 4chan users.</p><p>The code that all of these reverse proxies run were made by an anonymous user on 4chan.</p>47	<p>You are all nothing but worthless leeches.</p>48	<p>We do not like you. Stop using these proxies. Make your own.</p>49    <hr>50	<p>51		Want to talk? Add me on Discord.<br>52		<strong>Discord Username: "lainchan.org"</strong>53	</p>54  </body>55</html>'''56    # html = '''HuggingFace is, once again, currently experiencing a DDoS attack. Please check back within 24 hours. Due to being banned from the JanitorAI server under false pretenses, I am unable to properly communicate with you all. Apologies for the inconvenience. Discord tag: Moxxie#4385'''57    # return html58    return Response(html, status=403)59 60if __name__ == '__main__':61    app.run(host=host, port=port)