Update sweebot.py

This commit is contained in:
Nova Cat 2024-12-06 18:30:35 -08:00
parent 7e99e73011
commit 4e9da369db

View file

@ -22,13 +22,16 @@ app = Flask(__name__)
@app.route('/') @app.route('/')
def index_html(): def index_html():
return send_file("sweebot.html", mimetype='text/html') return send_file("dashboard.html", mimetype='text/html')
@app.route('/run.txt') @app.route('/run.txt')
def runs(): def runs():
return str(run) return str(run)
@app.route('/block.txt') @app.route('/block.txt')
def blocks(): def blocks():
return str(block) return str(block)
@app.route('/link.txt')
def blocks():
return str(parsed)
@app.route('/script.js') @app.route('/script.js')
def script_js(): def script_js():
return send_file("script.js", mimetype='application/javascript') return send_file("script.js", mimetype='application/javascript')
@ -687,6 +690,7 @@ while True:
multiline("(" + nick + ") [HTTP " + str(e.status_code) + "]", channel) multiline("(" + nick + ") [HTTP " + str(e.status_code) + "]", channel)
else: else:
multiline("(" + nick + ") [" + humanbytes(content_len) + " " + str(content_type) + "]", channel) multiline("(" + nick + ") [" + humanbytes(content_len) + " " + str(content_type) + "]", channel)
parsed += 1
except rex.SSLError as ex: except rex.SSLError as ex:
multiline("(" + nick + ") [SSL Error: " + str(ex.message) + "]", channel) multiline("(" + nick + ") [SSL Error: " + str(ex.message) + "]", channel)
except Exception as ex: except Exception as ex:
@ -704,6 +708,7 @@ while True:
multiline("(" + nick + ") [HTTP " + str(e.status_code) + "]", channel) multiline("(" + nick + ") [HTTP " + str(e.status_code) + "]", channel)
else: else:
multiline("(" + nick + ") [" + humanbytes(content_len) + " " + str(content_type) + "]", channel) multiline("(" + nick + ") [" + humanbytes(content_len) + " " + str(content_type) + "]", channel)
parsed += 1
except: except:
print(traceback.format_exc()) print(traceback.format_exc())
elif "JOIN" in text and "#nixsanctuary" in text: elif "JOIN" in text and "#nixsanctuary" in text: