From 0ca857bfd34f8934e18735b05268e4205697c5ee Mon Sep 17 00:00:00 2001 From: spoob Date: Tue, 13 Apr 2010 22:26:15 +0200 Subject: Fixed Megaupload --- module/plugins/hoster/MegauploadCom.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster') 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 -- cgit v1.2.3