Skip to content

Commit

Permalink
Merge pull request #23 from HadesD/main
Browse files Browse the repository at this point in the history
Check captcha length before send login request
  • Loading branch information
CookieGMVN authored Aug 7, 2024
2 parents a585e62 + f114903 commit cc2e06a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/MB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ export default class MB {
// Get captcha via OCR
const captchaContent = (await recognize(captchaBuffer, defaultTesseractConfig)).replaceAll("\n", "").replaceAll(" ", "").slice(0, -1);

// Check valid captcha by normal rule-base
if ((captchaContent.length !== 6) || !(/^[a-z0-9]+$/i.test(captchaContent))) {
return this.login();
}

// wasm
if (!this.wasmData) {
const wasm = await this.client.request({
Expand Down

0 comments on commit cc2e06a

Please sign in to comment.