Created
January 20, 2019 07:28
-
-
Save JaeTLDR/5e5385ac103905e5450113e38f5ce52c to your computer and use it in GitHub Desktop.
10 hours of fun, flask edition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Blueprint | |
bp = Blueprint('botfun', __name__) | |
from app.botfun import botfun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
''' | |
__author__ = "JaeTLDR" | |
__credits__ = ["JaeTLDR", "Nick Craver"] | |
__version__ = "1.0.0" | |
__maintainer__ = "JaeTLDR" | |
based on the Gist by Nick Craver | |
https://gist.github.com/NickCraver/c9458f2e007e9df2bdf03f8a02af1d13 | |
''' | |
from flask import Blueprint, redirect, request, jsonify | |
import random, time, os | |
from app.botfun import bp | |
# botfun = Blueprint('botfun', __name__) | |
@bp.route("/admin.php") | |
@bp.route("/admin/login.php") | |
@bp.route("/administrator/index.php") | |
@bp.route("/ajaxproxy/proxy.php") | |
@bp.route("/bitrix/admin/index.php") | |
@bp.route("/index.php") | |
@bp.route("/magmi/web/magmi.php") | |
@bp.route("/wp-admin/admin-ajax.php") | |
@bp.route("/wp-admin/includes/themes.php") | |
@bp.route("/wp-admin/options-link.php") | |
@bp.route("/wp-admin/post-new.php") | |
@bp.route("/wp-login.php") | |
@bp.route("/xmlrpc.php") | |
def botroute(): | |
f = [ | |
"https://www.youtube.com/watch?v=wbby9coDRCk", | |
"https://www.youtube.com/watch?v=nb2evY0kmpQ", | |
"https://www.youtube.com/watch?v=eh7lp9umG2I", | |
"https://www.youtube.com/watch?v=z9Uz1icjwrM", | |
"https://www.youtube.com/watch?v=Sagg08DrO5U", | |
"https://www.youtube.com/watch?v=A3YmHZ9HMPs", | |
"https://www.youtube.com/watch?v=jI-kpVh6e1U", | |
"https://www.youtube.com/watch?v=jScuYd3_xdQ", | |
"https://www.youtube.com/watch?v=S5PvBzDlZGs", | |
"https://www.youtube.com/watch?v=9UZbGgXvCCA", | |
"https://www.youtube.com/watch?v=O-dNDXUt1fg", | |
"https://www.youtube.com/watch?v=MJ5JEhDy8nE", | |
"https://www.youtube.com/watch?v=VnnWp_akOrE", | |
"https://www.youtube.com/watch?v=jwGfwbsF4c4", | |
"https://www.youtube.com/watch?v=8ZcmTl_1ER8", | |
"https://www.youtube.com/watch?v=gLmcGkvJ-e0", | |
"https://www.youtube.com/watch?v=hGlyFc79BUE", | |
"https://www.youtube.com/watch?v=KMFOVSWn0mI", | |
"https://www.youtube.com/watch?v=clU0Sh9ngmY", | |
"https://www.youtube.com/watch?v=sCNrK-n68CM" | |
] | |
res = { | |
"video": random.choice(f), | |
"time":time.time(), | |
"route":request.path, | |
"config":os.environ['FLASK_ENV'] | |
} | |
print(res) | |
if os.environ['FLASK_ENV'] != "production": | |
return jsonify(res) | |
else: | |
return redirect(random.choice(f), code=302) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment