Skip to content

NeuroSymbol/colab

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAS-captcha-api

CAS-captcha 启发,使用其训练得到的 onnx 文件搭建的在线验证码识别 api,部署在 vercel 平台。

使用

import requests
import json

captcha_url = "https://cas.sysu.edu.cn/cas/captcha.jsp"
imbyte = requests.get(captcha_url).content

def recognize(imbyte):
    headers = {'Authorization': 'TOKEN'}
    r = requests.post(f'https://cascaptcha.vercel.app/api', files={'imgfile': ('captcha.jpg', imbyte)},
                    headers=headers)
    res = json.loads(r.text)
    if res['success']:
        return res['captcha']
    return False

print(recognize(imbyte))

注意

为避免滥用,设置了 token 验证,可自行 fork 后在 vercel 搭建使用

About

Recognize the captcha on SYSU CAS website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 94.3%
  • Python 5.7%