diff options
author | André Glüpker <git@wgmd.de> | 2016-08-16 09:33:39 +0200 |
---|---|---|
committer | André Glüpker <git@wgmd.de> | 2016-08-16 09:33:39 +0200 |
commit | 26efee84e9143600171fca540bf81e6fba198100 (patch) | |
tree | 1da5b4c2b5fcb5b205aeff995fd225db03825909 | |
parent | 2da10b84685df5c0078299d962a1a3ac66515150 (diff) | |
download | 9kwpyqt-26efee84e9143600171fca540bf81e6fba198100.tar.gz 9kwpyqt-26efee84e9143600171fca540bf81e6fba198100.tar.bz2 9kwpyqt-26efee84e9143600171fca540bf81e6fba198100.zip |
Fix bug with invalid server answers.
(hopefully not introducing a new bug)
-rwxr-xr-x | 9kwpyqt.py | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -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') |