From b31b2df26d5c21a2caf4d7877c484cceccf4e260 Mon Sep 17 00:00:00 2001 From: spoob Date: Thu, 8 Apr 2010 16:23:08 +0200 Subject: Cleaned Megaupload --- module/plugins/hoster/MegauploadCom.py | 44 ++++++++-------------------------- 1 file changed, 10 insertions(+), 34 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index c282aa735..deeedc691 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -22,63 +22,39 @@ class MegauploadCom(Plugin): props['author_mail'] = ("spoob@pyload.org") self.props = props self.parent = parent - self.time_plus_wait = None #time() + wait in seconds - + self.time_plus_wait = None self.html = [None, None] - self.want_reconnect = False self.init_ocr() self.multi_dl = False def download_html(self): - url = self.parent.url - captcha_image = tempfile.NamedTemporaryFile(suffix=".gif").name for i in range(5): - self.html[0] = self.req.load(url, cookies=True) + self.html[0] = self.req.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.req.download(url_captcha_html, captcha_image, cookies=True) 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.req.load(url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar}, cookies=True) + self.html[1] = self.req.load(self.parent.url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar}, cookies=True) if re.search(r"Waiting time before each download begins", self.html[1]) != None: - print "got it" break self.time_plus_wait = time() + 45 def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_url_pattern = 'id="downloadlink">