diff options
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/MegauploadCom.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index a544775d4..ffe0bdba7 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -31,14 +31,18 @@ class MegauploadCom(Plugin): captcha_image = tempfile.NamedTemporaryFile(suffix=".gif").name for i in range(5): - self.html[0] = self.load(self.parent.url, cookies=True) - url_captcha_html = re.search('(http://www.{,3}\.megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1) - self.download(url_captcha_html, captcha_image, cookies=True) + self.html[0] = self.load(self.parent.url) + try: + url_captcha_html = re.search('(http://www.{,3}\.megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1) + except: + continue + self.pyfile.status.waituntil = time() + 10 + self.req.download(url_captcha_html, captcha_image) captcha = self.ocr.get_captcha(captcha_image) os.remove(captcha_image) captchacode = re.search('name="captchacode" value="(.*)"', self.html[0]).group(1) megavar = re.search('name="megavar" value="(.*)">', self.html[0]).group(1) - self.html[1] = self.load(self.parent.url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar}, cookies=True) + self.html[1] = self.load(self.parent.url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar}) if re.search(r"Waiting time before each download begins", self.html[1]) != None: break self.time_plus_wait = time() + 45 |