diff options
author | spoob <spoob@gmx.de> | 2010-04-13 22:26:15 +0200 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2010-04-13 22:26:15 +0200 |
commit | 0ca857bfd34f8934e18735b05268e4205697c5ee (patch) | |
tree | d5ea0a12ebc852b47153b7bde707de42b00587ea | |
parent | Pack Fixes (diff) | |
download | pyload-0ca857bfd34f8934e18735b05268e4205697c5ee.tar.xz |
Fixed Megaupload
-rw-r--r-- | module/Plugin.py | 2 | ||||
-rw-r--r-- | module/plugins/hoster/MegauploadCom.py | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/module/Plugin.py b/module/Plugin.py index fd230c400..587cbb4f1 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -53,9 +53,9 @@ class Plugin(): self.ocr = None #captcha reader instance self.logger = logging.getLogger("log") self.decryptNow = True - self.pyfile = self.parent def prepare(self, thread): + self.pyfile = self.parent self.want_reconnect = False self.pyfile.status.exists = self.file_exists() 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 |