diff options
-rw-r--r-- | module/plugins/hoster/NetloadIn.py | 6 | ||||
-rw-r--r-- | module/plugins/hoster/RapidshareCom.py | 1 | ||||
-rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 18 |
3 files changed, 17 insertions, 8 deletions
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index d0e5b89ba..3c959d0d5 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -102,8 +102,10 @@ class NetloadIn(Plugin): sleep(5) self.html[2] = self.req.load("http://netload.in/index.php?id=10", post={"file_id": file_id, "captcha_check": captcha}, cookies=True) - if re.search(r"(We will prepare your download..|We had a reqeust with the IP)", self.html[2]) != None: - break + if re.search(r"(We will prepare your download..|We had a request with the IP)", self.html[2]) != None: + return True + + raise Exception("Captcha not decrypted") def get_file_url(self): try: diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 14dacb9d5..41640b4e1 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -40,6 +40,7 @@ class RapidshareCom(Plugin): def prepare(self, thread): pyfile = self.parent self.req.clear_cookies() + self.no_slots = True self.want_reconnect = False self.download_api_data() diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 63d05c47a..524f02930 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -7,6 +7,8 @@ import tempfile from time import time from base64 import b64decode import hashlib +import random +from time import sleep from module.Plugin import Plugin @@ -80,24 +82,28 @@ class ShareonlineBiz(Plugin): self.html[0] = self.req.load(url, cookies=True) if not self.config['premium']: - captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name + #captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name for i in range(10): - self.req.download("http://www.share-online.biz/captcha.php", captcha_image, cookies=True) + + captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name + self.req.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)) + sleep(3) self.html[1] = self.req.load(url, post={"captchacode": captcha}, cookies=True) if re.search(r"Der Download ist Ihnen zu langsam", self.html[1]) != None: self.time_plus_wait = time() + 15 - break - - os.remove(captcha_image) + return True + raise Exception("Captcha not decrypted") + def get_file_url(self): """ returns the absolute downloadable filepath """ if not self.want_reconnect: - file_url_pattern = 'loadfilelink\.decode\("(.*)\); document' + file_url_pattern = 'loadfilelink\.decode\("([^"]+)' return b64decode(re.search(file_url_pattern, self.html[1]).group(1)) else: return False |