diff options
| author | 2010-05-17 00:01:05 +0200 | |
|---|---|---|
| committer | 2010-05-17 00:01:05 +0200 | |
| commit | 32ba2f79389ccf4f7d40197837c02d28bb13261d (patch) | |
| tree | 893de3556630eaa8242fa0fe3550039cab210b09 /module/plugins/hoster/ShareonlineBiz.py | |
| parent | new config option (outgoing intreface) (diff) | |
| download | pyload-32ba2f79389ccf4f7d40197837c02d28bb13261d.tar.xz | |
new plugin interface test, ShareonlineBiz + SerienjunkiesOrg + MegauploadedCom fix, other stuff
Diffstat (limited to 'module/plugins/hoster/ShareonlineBiz.py')
| -rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 26 | 
1 files changed, 19 insertions, 7 deletions
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 9cc0f8263..13d240bb4 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -39,7 +39,12 @@ class ShareonlineBiz(Hoster):          self.download_api_data()          if self.api_data["status"]: -            self.download_html() +            for i in range(5): +                if self.download_html(): +                    break +                else: +                    pyfile.status.waituntil = self.time_plus_wait +                    thread.wait(self.pyfile)              pyfile.status.filename = self.api_data["filename"]              pyfile.status.waituntil = self.time_plus_wait              pyfile.status.url = self.get_file_url() @@ -84,18 +89,25 @@ class ShareonlineBiz(Hoster):              for i in range(10): -                captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name -                self.download("http://www.share-online.biz/captcha.php?rand="+ "0." + str(random.randint(10**15,10**16)), captcha_image, cookies=True) -                captcha = self.ocr.get_captcha(captcha_image) -                os.remove(captcha_image) -                self.logger.debug("Captcha %s: %s" % (i, captcha)) +                captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg", delete=False) +                imgStr = self.req.load("http://www.share-online.biz/captcha.php?rand="+ "0." + str(random.randint(10**15,10**16)), cookies=True) +                captcha_image.write(imgStr) +                captcha_image.close() +                captcha = self.ocr.get_captcha(captcha_image.name) +                os.remove(captcha_image.name) +                self.logger.debug("%s Captcha %s: %s" % (self.__name__, i, captcha))                  sleep(3)                  self.html[1] = self.load(url, post={"captchacode": captcha}, cookies=True) -                if re.search(r"Der Download ist Ihnen zu langsam", self.html[1]) != None: +                if re.search(r"no slots available", self.html[1]): +                    self.time_plus_wait = time() + 60 +                    return False +                if re.search(r"Der Download ist Ihnen zu langsam", self.html[1]):                      self.time_plus_wait = time() + 15                      return True              raise Exception("Captcha not decrypted") +        else: +            return True      def get_file_url(self):          """ returns the absolute downloadable filepath  | 
