diff --git a/__pycache__/app.cpython-39.pyc b/__pycache__/app.cpython-39.pyc new file mode 100644 index 0000000..9c89fc1 Binary files /dev/null and b/__pycache__/app.cpython-39.pyc differ diff --git a/app.py b/app.py index 841efa2..88137de 100644 --- a/app.py +++ b/app.py @@ -2,12 +2,22 @@ from flask import Flask, render_template, request, make_response, redirect from numpy import real from freecaptcha import captcha import uuid +import os app = Flask(__name__, static_url_path='', static_folder='static',) captcha_solutions = {} captcha_solved = [] +@app.route("/captcha2", methods=['GET']) +def captcha2(): + with open('templates/captcha2play.html') as play_template_file: + return play_template_file.read() + +@app.route("/captcha3", methods=['GET']) +def captcha3(): + return captcha.generate_captcha_html(os.listdir('static/images/')) + @app.route("/captcha", methods=['GET', 'POST']) def login(): # This means they just submitted a CAPTCHA diff --git a/freecaptcha/__pycache__/__init__.cpython-39.pyc b/freecaptcha/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000..db47260 Binary files /dev/null and b/freecaptcha/__pycache__/__init__.cpython-39.pyc differ diff --git a/freecaptcha/__pycache__/captcha.cpython-39.pyc b/freecaptcha/__pycache__/captcha.cpython-39.pyc new file mode 100644 index 0000000..6edb412 Binary files /dev/null and b/freecaptcha/__pycache__/captcha.cpython-39.pyc differ diff --git a/freecaptcha/captcha.py b/freecaptcha/captcha.py index 2810876..d0c25a5 100644 --- a/freecaptcha/captcha.py +++ b/freecaptcha/captcha.py @@ -4,6 +4,88 @@ from PIL import Image import base64 from io import BytesIO +import os + +def generate_layers(images, index=0): + if len(images) == 0: + return '' + + + return f''' + ''' + +def generate_captcha_html(images): + html = '' + html_prelude = ''' + +
+