Commits

ranan committed c5af3c8

closed #246, #247, #248, #249,

Comments (0)

Files changed (3)

module/plugins/hoster/FileserveCom.py

             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)
 
         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"})

module/plugins/hoster/FilesonicCom.py

         found = re.findall(r'<tr>\s+<td class="source"><span>([^<]+)</span></td>\s+<td class="fileName"><span>([^<]+)</span></td>\s+<td class="fileSize"><span>([0-9]+) MB</span></td>\s+<td class="availability"><span>\s+<strong style="font-weight: strong; color: green;">([^<]+)</strong><br />\s+</span>\s+</td>\s+</tr>', 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))
 
 
                 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))
             
                             "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

module/plugins/hoster/RapidshareCom.py

 
             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.")
             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