Greasy Fork is available in English.

HFUT Captcha Filler

合工大信息门户验证码自动填写,开发版本,调用百度云通用文字识别接口,不保证准确度。

2020-02-17 일자. 최신 버전을 확인하세요.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
// ==UserScript==
// @name               HFUT Captcha Filler
// @name:zh            合工大信息门户验证码自动填写
// @name:zh-CN         合工大信息门户验证码自动填写
// @description:zh     合工大信息门户验证码自动填写,开发版本,调用百度云通用文字识别接口,不保证准确度。
// @description:zh-CN  合工大信息门户验证码自动填写,开发版本,调用百度云通用文字识别接口,不保证准确度。
// @version            0.0.2
// @author             Zijun Yu
// @include            http://my.hfut.edu.cn
// @include            http://my.hfut.edu.cn/login.portal
// @grant              GM.xmlhttpRequest
// @namespace https://greasyfork.org/users/443103
// @description 合工大信息门户验证码自动填写,开发版本,调用百度云通用文字识别接口,不保证准确度。
// ==/UserScript==

setTimeout(function () {
  var api = 'https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token=24.a227a80dd03bacb2059c50d1021d6cf7.2592000.1583841714.282335-18426133';
  var imgElement = document.getElementById('captchaImg');
  var canvasElement = document.createElement('canvas');
  canvasElement.height = 100;
  canvasElement.width = 230;
  canvasElement.getContext('2d').drawImage(imgElement, 0, 0);
  var base64 = canvasElement.toDataURL().split(',')[1];
  // console.log(base64);
  
  GM.xmlhttpRequest({
    method: 'POST',
    url: api,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    },
    data: `image=${base64}`,
    onreadystatechange: function (res) {
      console.log(res);
    }
  });
}, 2000);