diff options
Diffstat (limited to '9kwpyqt.py')
-rwxr-xr-x | 9kwpyqt.py | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -32,6 +32,9 @@ class CaptchaGUI(QWidget): apiurl = API_URL+"?source=pythonapi&apikey="+API_KEY+"&" offlinemessage = "Click \"Start\" to fetch next captcha." + waitingoncaptcha = 0 + + def __init__(self, parent=None): super(CaptchaGUI, self).__init__(parent) self.setMinimumWidth(400) @@ -221,14 +224,19 @@ class CaptchaGUI(QWidget): content = str(self.networkCaptchaIDReply.readAll(), encoding='utf-8') self.networkCaptchaIDReply.deleteLater() if content == 'NO CAPTCHA': - status = self.captchaImage.text()+"." + self.waitingoncaptcha += 1 + status = "Server responded with 'NO CAPTCHA' "+str(self.waitingoncaptcha)+" times." self.captchaImage.setText(status) QTimer.singleShot(1000, self.getCaptchaID) - elif not content.isnumeric(): - self.captchaImage.setText("Unknown error? ID not 'NO CAPTCHA' nor number") - else: + elif content.isnumeric(): + self.waitingoncaptcha = 0 + print("New Captcha:", int(content)) self.currentCaptchaID = int(content) self.getCaptchaIMG() + else: + self.waitingoncaptcha += 1 + print("Unknown error? ID not 'NO CAPTCHA' nor number") + print(content) def getCaptchaIMG(self): url = QUrl(self.apiurl+"action=usercaptchashow&id="+str(self.currentCaptchaID)) |