summaryrefslogtreecommitdiff
path: root/9kwpyqt.py
diff options
context:
space:
mode:
Diffstat (limited to '9kwpyqt.py')
-rwxr-xr-x9kwpyqt.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/9kwpyqt.py b/9kwpyqt.py
index 047db9c..b29a185 100755
--- a/9kwpyqt.py
+++ b/9kwpyqt.py
@@ -300,19 +300,14 @@ class CaptchaGUI(QWidget):
def setCaptchaAnswerCommit(self):
message = str(self.networkCaptchaAnswerReply.readAll(), encoding='utf-8')
self.networkCaptchaAnswerReply.deleteLater()
- if not message:
- # TODO: Server error? Retry! (Status 200 + no 'OK'?)
- self.networkCaptchaAnswerReply = self.NetworkManager.get(self.networkCaptchaAnswer)
- self.networkCaptchaAnswerReply.finished.connect(self.setCaptchaAnswerCommit)
- else:
- self.currentCommited += 1
- self.currentCaptchaID = None
+ if message:
if message.startswith('OK') and '|' in message:
parts = message.split('|')
- creds = int(parts[1])
- self.currentCredits += creds
- self.updateStats()
- self.getCaptchaID()
+ if parts[1].isnumeric():
+ self.currentCredits += int(parts[1])
+ self.currentCommited += 1
+ self.updateStats()
+ self.getCaptchaID()
def setCaptchaAnswerSkipped(self):
message = str(self.networkCaptchaAnswerReply.readAll(), encoding='utf-8')