summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/DataportCz.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-01 04:55:17 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-01 04:55:17 +0200
commit25d5726d4953b93a2e286fd6af8d4ead20670ba6 (patch)
tree9d38f6942af2fadc094a75dd43699051f356b4d7 /module/plugins/hoster/DataportCz.py
parent[AntiVirus] Folder support (diff)
downloadpyload-25d5726d4953b93a2e286fd6af8d4ead20670ba6.tar.xz
A lot of plugin code cosmetics
Diffstat (limited to 'module/plugins/hoster/DataportCz.py')
-rw-r--r--module/plugins/hoster/DataportCz.py46
1 files changed, 20 insertions, 26 deletions
diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py
index 2b30df059..fe304fdea 100644
--- a/module/plugins/hoster/DataportCz.py
+++ b/module/plugins/hoster/DataportCz.py
@@ -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"))
-
- if "captchaId" in inputs and inputs['captchaId'] in captchas:
- inputs['captchaCode'] = captchas[inputs['captchaId']]
- else:
- self.error(_("captcha"))
-
- self.download("http://www.dataport.cz%s" % action, post=inputs)
-
- 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.error(_("invalid 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
+ 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 not found"))
+
+ self.download("http://www.dataport.cz%s" % action, post=inputs)
+
+ 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.retry(wait=60)
getInfo = create_getInfo(DataportCz)