diff options
Diffstat (limited to 'module/plugins/hoster/DataportCz.py')
-rw-r--r-- | module/plugins/hoster/DataportCz.py | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index 15caae1f7..fe304fdea 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -6,7 +6,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DataportCz(SimpleHoster): __name__ = "DataportCz" __type__ = "hoster" - __version__ = "0.42" + __version__ = "0.43" __status__ = "testing" __pattern__ = r'http://(?:www\.)?dataport\.cz/file/(.+)' @@ -28,32 +28,26 @@ class DataportCz(SimpleHoster): def handle_free(self, pyfile): captchas = {'1': "jkeG", '2': "hMJQ", '3': "vmEK", '4': "ePQM", '5': "blBd"} - for _i in xrange(60): - action, inputs = self.parse_html_form('free_download_form') - self.log_debug(action, inputs) - if not action or not inputs: - self.error(_("free_download_form")) + action, inputs = self.parse_html_form('free_download_form') + self.log_debug(action, inputs) + if not action or not inputs: + self.error(_("free_download_form")) - if "captchaId" in inputs and inputs['captchaId'] in captchas: - inputs['captchaCode'] = captchas[inputs['captchaId']] - else: - self.error(_("captcha")) + if "captchaId" in inputs and inputs['captchaId'] in captchas: + inputs['captchaCode'] = captchas[inputs['captchaId']] + else: + self.error(_("Captcha not found")) - self.download("http://www.dataport.cz%s" % action, post=inputs) + self.download("http://www.dataport.cz%s" % action, post=inputs) - check = self.check_download({'captcha': 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', - 'slot' : 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) - if check == "captcha": - self.error(_("invalid captcha")) + check = self.check_file({'captcha': 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', + 'slot' : 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) + if check == "captcha": + self.retry_captcha() - elif check == "slot": - self.log_debug("No free slots - wait 60s and retry") - self.wait(60, False) - self.html = self.load(pyfile.url) - continue - - else: - break + elif check == "slot": + self.log_debug("No free slots - wait 60s and retry") + self.retry(wait=60) getInfo = create_getInfo(DataportCz) |