From cac52bbf8b0e928a83a29b744bff20240c8e7354 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 6 Oct 2010 22:24:17 +0200 Subject: freakshare premium, closed #146, closed #147 --- module/plugins/hoster/FreakshareCom.py | 13 +++++++++---- module/plugins/hoster/MegauploadCom.py | 15 +++++++++------ module/plugins/hoster/RapidshareCom.py | 4 ++++ 3 files changed, 22 insertions(+), 10 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 524081002..bbc22ac98 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -23,10 +23,16 @@ class FreakshareCom(Hoster): def process(self, pyfile): pyfile.url = pyfile.url.replace("freakshare.net/","freakshare.com/") - self.prepare() - self.get_file_url() + if self.account: + self.html = self.load(pyfile.url, cookies=False) + pyfile.name = self.get_file_name() + self.download(pyfile.url) - self.download(self.pyfile.url, post=self.req_opts) + else: + self.prepare() + self.get_file_url() + + self.download(self.pyfile.url, post=self.req_opts) def prepare(self): @@ -48,7 +54,6 @@ class FreakshareCom(Hoster): return True def download_html(self): - url = self.pyfile.url.replace("freakshare.net/","freakshare.com/") self.html = self.load(url, cookies=True) def get_file_url(self): diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index 4c851a5b2..b913976a0 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -76,17 +76,19 @@ class MegauploadCom(Hoster): pyfile.name = self.get_file_name() self.download(self.get_file_url()) + check = self.checkDownload({"limit": "Download limit exceeded"}) + if check == "limit": + wait = self.load("http://www.megaupload.com/?c=premium&l=1") + wait = re.search(r"Please wait (\d+) minutes", wait).group(1) + self.log.info(_("Megaupload: waiting %d minues") % wait) + self.setWait(int(wait)*60, True) + self.wait() + self.process(pyfile) else: self.download_api() pyfile.name = self.get_file_name() self.download(pyfile.url) - check = self.checkDownload({"limit": "Download limit exceeded"}) #@TODO catch it earlier in html pages if possible - if check == "limit": - self.setWait(3600, True) - self.wait() - self.process(pyfile) - def download_html(self): for i in range(5): self.html[0] = self.load(self.pyfile.url) @@ -117,6 +119,7 @@ class MegauploadCom(Hoster): if re.search(r"Waiting time before each download begins", self.html[1]) is not None: break + print self.html[0] def download_api(self): diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 40fe05eeb..0e3d2e74d 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -212,6 +212,10 @@ class RapidshareCom(Hoster): self.setWait(60) self.log.info(_("Already downloading from this ip address, waiting 60 seconds")) self.wait() + elif "Too many users downloading from this server right now" in result: + self.setWait(120) + self.log.info(_("RapidShareCom: No free slots")) + self.wait() elif between_wait: self.setWait(int(between_wait.group(1))) self.wantReconnect = True -- cgit v1.2.3