Limit number of autoretries on posting error. #1302
This commit is contained in:
parent
32ad98a0d6
commit
f89f9a2bbb
@ -775,12 +775,17 @@ QR =
|
||||
delete QR.currentCaptcha
|
||||
|
||||
if err
|
||||
QR.errorCount = (QR.errorCount or 0) + 1
|
||||
if /captcha|verification/i.test(err.textContent) or connErr
|
||||
# Remove the obnoxious 4chan Pass ad.
|
||||
if /mistyped/i.test err.textContent
|
||||
err = 'You mistyped the CAPTCHA, or the CAPTCHA malfunctioned.'
|
||||
else if /expired/i.test err.textContent
|
||||
err = 'This CAPTCHA is no longer valid because it has expired.'
|
||||
if QR.errorCount >= 5
|
||||
# Too many posting errors can ban you. Stop autoposting after 5 errors.
|
||||
QR.cooldown.auto = false
|
||||
else
|
||||
# Something must've gone terribly wrong if you get captcha errors without captchas.
|
||||
# Don't auto-post indefinitely in that case.
|
||||
QR.cooldown.auto = QR.captcha.isEnabled or connErr
|
||||
@ -802,6 +807,8 @@ QR =
|
||||
QR.error err
|
||||
return
|
||||
|
||||
delete QR.errorCount
|
||||
|
||||
h1 = $ 'h1', @response
|
||||
|
||||
[_, threadID, postID] = h1.nextSibling.textContent.match /thread:(\d+),no:(\d+)/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user