Prepare to start some cooldown when an incorrect captcha was input to avoid autoban.
Remove redundant "Error:".
This commit is contained in:
parent
de4c34746c
commit
6bc0fb18d9
@ -1560,7 +1560,7 @@
|
||||
});
|
||||
reply = qr.replies[0];
|
||||
if (!(reply.com || reply.file)) {
|
||||
err = 'Error: No file selected.';
|
||||
err = 'No file selected.';
|
||||
} else {
|
||||
captchas = $.get('captchas', []);
|
||||
while ((captcha = captchas[0]) && captcha.time < Date.now()) {
|
||||
@ -1575,7 +1575,7 @@
|
||||
}
|
||||
$.set('captchas', captchas);
|
||||
qr.captcha.count(captchas.length);
|
||||
if (!response) err = 'Error: No valid captcha.';
|
||||
if (!response) err = 'No valid captcha.';
|
||||
}
|
||||
if (err) {
|
||||
qr.error(err);
|
||||
@ -1628,8 +1628,7 @@
|
||||
} else if (b.childElementCount) {
|
||||
if (b.firstChild.tagName) node = b.firstChild;
|
||||
err = b.firstChild.textContent;
|
||||
log(b);
|
||||
console.dir(b);
|
||||
if (err === 'You seem to have mistyped the verification.') {}
|
||||
}
|
||||
if (err) {
|
||||
qr.error(err, node);
|
||||
|
||||
@ -1157,7 +1157,7 @@ qr =
|
||||
|
||||
# prevent errors
|
||||
unless reply.com or reply.file
|
||||
err = 'Error: No file selected.'
|
||||
err = 'No file selected.'
|
||||
else
|
||||
# get oldest valid captcha
|
||||
captchas = $.get 'captchas', []
|
||||
@ -1173,7 +1173,7 @@ qr =
|
||||
$.set 'captchas', captchas
|
||||
qr.captcha.count captchas.length
|
||||
unless response
|
||||
err = 'Error: No valid captcha.'
|
||||
err = 'No valid captcha.'
|
||||
|
||||
# more error prevention ?
|
||||
if err
|
||||
@ -1226,9 +1226,8 @@ qr =
|
||||
else if b.childElementCount # error!
|
||||
node = b.firstChild if b.firstChild.tagName # duplicate image link
|
||||
err = b.firstChild.textContent
|
||||
log b
|
||||
console.dir b
|
||||
# error handling
|
||||
if err is 'You seem to have mistyped the verification.'
|
||||
;# cooldown to prevent autoban
|
||||
|
||||
if err
|
||||
qr.error err, node
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user