Created
November 19, 2019 09:13
Revisions
-
cokia created this gist
Nov 19, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ #-*- coding: utf-8 -*- from flask import Flask, request import os import base64 import urllib.parse import json import subprocess app = Flask(__name__) @app.route("/captcha", methods=["GET"]) def captcha1(): base164 = request.args.get('image') #title data = urllib.parse.unquote(base164) #data = json.loads(base64) png_recovered = base64.b64decode(data) x = subprocess.check_output(['tesseract temp.png a.txt -c tessedit_char_whitelist=0123456789']) f = open("a.txt", "r") fi = f.read() f.close() print(fi) return str(fi) if __name__ == '__main__': app.run(host='0.0.0.0', port=5000, debug=False)