summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/ShareonlineBiz.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/ShareonlineBiz.py')
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py34
1 files changed, 16 insertions, 18 deletions
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index a01dd86a3..95cedc140 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -83,27 +83,25 @@ class ShareonlineBiz(Hoster):
self.wait()
self.retry()
- return True
-
-
- # captcha = self.decryptCaptcha("http://www.share-online.biz/captcha.php", get={"rand":"0.%s" % random.randint(10**15,10**16)}, cookies=True)
+ if "Captcha number error or expired" in html:
+ captcha = self.decryptCaptcha("http://www.share-online.biz/captcha.php", get={"rand":"0.%s" % random.randint(10**15,10**16)}, cookies=True)
+
+ self.log.debug("%s Captcha: %s" % (self.__name__, captcha))
+ sleep(3)
- # self.log.debug("%s Captcha: %s" % (self.__name__, captcha))
- # sleep(3)
-
- # html = self.load(self.pyfile.url, post={"captchacode": captcha}, cookies=True)
- # return True
-
-
- #m = re.search("var timeout='(\d+)';", self.html[1])
- #self.waitUntil = time() + int(m.group(1)) if m else 30
- # if r"Der Download ist Ihnen zu langsam" in html:
- # return True
+ html = self.load(self.pyfile.url, post={"captchacode": captcha}, cookies=True)
+
+ if r"Der Download ist Ihnen zu langsam" not in html and r"The download is too slow for you" not in html:
+ self.fail("Plugin defect. Save dumps and report.")
- # if r"The download is too slow for you" in html:
- # return True
+ m = re.search("var timeout='(\d+)';", self.html[1])
+ wait_time = int(m.group(1)) if m else 30
+ self.setWait(wait_time)
+ self.log.debug("%s: Waiting %d seconds." % (self.__name__, wait_time))
+ self.wait()
- self.retry()
+ return True
+
else:
if r"Die Nummer ist leider nicht richtig oder ausgelaufen!" in self.html:
self.retry()