summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Glüpker <git@wgmd.de>2016-08-16 09:33:39 +0200
committerAndré Glüpker <git@wgmd.de>2016-08-16 09:33:39 +0200
commit26efee84e9143600171fca540bf81e6fba198100 (patch)
tree1da5b4c2b5fcb5b205aeff995fd225db03825909
parent2da10b84685df5c0078299d962a1a3ac66515150 (diff)
download9kwpyqt-26efee84e9143600171fca540bf81e6fba198100.tar.gz
9kwpyqt-26efee84e9143600171fca540bf81e6fba198100.tar.bz2
9kwpyqt-26efee84e9143600171fca540bf81e6fba198100.zip
Fix bug with invalid server answers.
(hopefully not introducing a new bug)
-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')