From d5d580b693af56d286008da47a3e30bdc5f79aed Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 12 Mar 2011 11:32:50 +0100 Subject: closed #246, #247, #248, #249, --- module/plugins/hoster/FileserveCom.py | 2 +- module/plugins/hoster/FilesonicCom.py | 9 +++++++-- module/plugins/hoster/RapidshareCom.py | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 852dbb5b8..0ab97a4c7 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -55,6 +55,7 @@ class FileserveCom(Hoster): self.multiDL = False self.file_id = re.search(r"fileserve\.com/file/([a-zA-Z0-9]+)(http:.*)?", self.pyfile.url).group(1) + self.pyfile.url = "http://www.fileserve.com/file/" + self.file_id def process(self, pyfile): self.html = self.load(self.pyfile.url, ref=False, cookies=False if self.account else True, utf8=True) @@ -81,7 +82,6 @@ class FileserveCom(Hoster): self.html = self.load(self.pyfile.url) jsPage = re.search(r"\"(/landing/.*?/download_captcha\.js)\"", self.html) - self.req.putHeader("X-Requested-With", "XMLHttpRequest") jsPage = self.load("http://fileserve.com" + jsPage.group(1)) action = self.load(self.pyfile.url, post={"checkDownload" : "check"}) diff --git a/module/plugins/hoster/FilesonicCom.py b/module/plugins/hoster/FilesonicCom.py index 1d5a5ceef..97060d36e 100644 --- a/module/plugins/hoster/FilesonicCom.py +++ b/module/plugins/hoster/FilesonicCom.py @@ -16,7 +16,6 @@ def getInfo(urls): found = re.findall(r'\s+([^<]+)\s+([^<]+)\s+([0-9]+) MB\s+\s+([^<]+)
\s+
\s+\s+', page, re.MULTILINE) result = [] for src, name, size, status in found: - print src, name, size, status result.append((name, int(size)*1024*1024, 2 if status == "Available" else 1, src)) @@ -91,7 +90,9 @@ class FilesonicCom(Hoster): self.fail("implement need pw") chall = re.search(r'Recaptcha.create\("(.*?)",', self.html) - if chall: + for i in range(5): + if not chall: break + re_captcha = ReCaptcha(self) challenge, result = re_captcha.challenge(chall.group(1)) @@ -99,6 +100,10 @@ class FilesonicCom(Hoster): "recaptcha_response_field" : result} self.html = self.load(link, post=postData) + chall = re.search(r'Recaptcha.create\("(.*?)",', self.html) + + if chall: + self.invalidCaptcha() url = re.search(realLinkRegexp, self.html).group(1) return url diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 2f6ce4739..6a4eedd51 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -107,7 +107,7 @@ class RapidshareCom(Hoster): self.download(self.pyfile.url) - elif self.api_data["status"] in ("4","5"): + elif self.api_data["status"] in ("0","4","5"): self.offline() else: self.fail("Unknown response code.") @@ -202,6 +202,8 @@ class RapidshareCom(Hoster): self.setWait(120) self.log.info(_("RapidShareCom: No free slots")) self.wait() + elif "This file is too big to download it for free" in result: + self.fail(_("You need a premium account for this file")) elif between_wait: self.setWait(int(between_wait.group(1))) self.wantReconnect = True -- cgit v1.2.3