First, setting up the file tsconfig.json
to compile the typescript files into javascript files.
{
"compilerOptions": {
"module": "commonjs",
from datetime import datetime, timedelta, timezone | |
from jose import jwt # or import jwt | |
from cryptography.hazmat.primitives import serialization | |
from cryptography.hazmat.primitives.asymmetric import rsa | |
from cryptography.hazmat.backends import default_backend | |
# --- Generate private and public key --- | |
key = rsa.generate_private_key( |
from PIL import Image | |
from scipy.ndimage import gaussian_filter | |
import numpy | |
import pytesseract | |
from PIL import ImageFilter | |
def solve_captcha(filename): | |
# thresold1 on the first stage | |
th1 = 140 | |
th2 = 140 # threshold after blurring |