diff options
Diffstat (limited to 'module/plugins/hoster/FileboomMe.py')
| -rw-r--r-- | module/plugins/hoster/FileboomMe.py | 76 | 
1 files changed, 31 insertions, 45 deletions
| diff --git a/module/plugins/hoster/FileboomMe.py b/module/plugins/hoster/FileboomMe.py index 4328565f4..1a2c89b0b 100644 --- a/module/plugins/hoster/FileboomMe.py +++ b/module/plugins/hoster/FileboomMe.py @@ -39,64 +39,50 @@ class FileboomMe(SimpleHoster):          post_url = urlparse.urljoin(pyfile.url, "file/" + self.info['pattern']['ID'])          m = re.search(r'data-slow-id="(\w+)"', self.html) -        if m: +        if m is not None:              self.html = self.load(post_url,                                    post={'slow_id': m.group(1)})              m = re.search(self.LINK_PATTERN, self.html) -            if m: +            if m is not None:                  self.link = urlparse.urljoin(pyfile.url, m.group(0))              else: -                for _i in xrange(5): -                    m = re.search(r'<input type="hidden" name="uniqueId" value="(\w+)">', self.html) -                    if m: -                        uniqueId = m.group(1) +                m = re.search(r'<input type="hidden" name="uniqueId" value="(\w+)">', self.html) +                if m is None: +                    m = re.search(r'>\s*Please wait ([\d:]+)', self.html) +                    if m is not None: +                        wait_time = 0 +                        for v in re.findall(r'(\d+)', m.group(1), re.I): +                            wait_time = 60 * wait_time + int(v) +                        self.wait(wait_time) +                        self.retry() -                        m = re.search(self.CAPTCHA_PATTERN, self.html) -                        if m: -                            captcha = self.captcha.decrypt(urlparse.urljoin(pyfile.url, m.group(1))) - -                            self.html = self.load(post_url, -                                                  post={'CaptchaForm[code]'  : captcha, -                                                        'free'               : 1, -                                                        'freeDownloadRequest': 1, -                                                        'uniqueId'           : uniqueId}) - -                            if 'The verification code is incorrect' in self.html: -                                self.captcha.invalid() - -                            else: -                                self.check_errors() - -                                self.html = self.load(post_url, -                                                      post={'free'    : 1, -                                                            'uniqueId': uniqueId}) - -                                m = re.search(self.LINK_PATTERN, self.html) -                                if m: -                                    self.link = urlparse.urljoin(pyfile.url, m.group(0)) +                else: +                    uniqueId = m.group(1) -                                else: -                                    self.captcha.invalid() +                    m = re.search(self.CAPTCHA_PATTERN, self.html) +                    if m is not None: +                        captcha = self.captcha.decrypt(urlparse.urljoin(pyfile.url, m.group(1))) +                        self.html = self.load(post_url, +                                              post={'CaptchaForm[code]'  : captcha, +                                                    'free'               : 1, +                                                    'freeDownloadRequest': 1, +                                                    'uniqueId'           : uniqueId}) -                                break +                        if 'The verification code is incorrect' in self.html: +                            self.retry_captcha()                          else: -                            self.fail(_("Captcha not found")) - -                    else: -                        m = re.search(r'>\s*Please wait ([\d:]+)', self.html) -                        if m: -                            wait_time = 0 -                            for v in re.findall(r'(\d+)', m.group(1), re.I): -                                wait_time = 60 * wait_time + int(v) -                            self.wait(wait_time) -                            self.retry() -                        break +                            self.check_errors() -                else: -                    self.fail(_("Invalid captcha")) +                            self.html = self.load(post_url, +                                                  post={'free'    : 1, +                                                        'uniqueId': uniqueId}) + +                            m = re.search(self.LINK_PATTERN, self.html) +                            if m is not None: +                                self.link = urlparse.urljoin(pyfile.url, m.group(0))  getInfo = create_getInfo(FileboomMe) | 
