diff options
| author | 2015-03-10 15:32:24 +0100 | |
|---|---|---|
| committer | 2015-03-10 15:32:24 +0100 | |
| commit | 58e98ab99bd7672492109786c4db7076d231631b (patch) | |
| tree | 35fd297e89fe7d675822d9880adbf4c8b9465d4d /module/plugins | |
| parent | [SimpleHoster] Fix https://github.com/pyload/pyload/issues/1242 (diff) | |
| download | pyload-58e98ab99bd7672492109786c4db7076d231631b.tar.xz | |
[FileSharkPl] Fix https://github.com/pyload/pyload/issues/1040 (2)
Diffstat (limited to 'module/plugins')
| -rw-r--r-- | module/plugins/hoster/FileSharkPl.py | 30 | ||||
| -rw-r--r-- | module/plugins/internal/SimpleHoster.py | 5 | 
2 files changed, 10 insertions, 25 deletions
| diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index ac669ab1b..df54997d8 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo  class FileSharkPl(SimpleHoster):      __name__    = "FileSharkPl"      __type__    = "hoster" -    __version__ = "0.08" +    __version__ = "0.09"      __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d+/\w+' @@ -20,10 +20,9 @@ class FileSharkPl(SimpleHoster):                         ("Walter Purcaro", "vuolter@gmail.com")] -    NAME_PATTERN = r'<h2 class="name-file">(?P<N>.+)</h2>' -    SIZE_PATTERN = r'<p class="size-file">(.*?)<strong>(?P<S>\d+\.?\d*)\s(?P<U>\w+)</strong></p>' - -    OFFLINE_PATTERN = '(P|p)lik zosta. (usuni.ty|przeniesiony)' +    NAME_PATTERN    = r'<h2 class="name-file">(?P<N>.+)</h2>' +    SIZE_PATTERN    = r'<p class="size-file">(.*?)<strong>(?P<S>\d+\.?\d*)\s(?P<U>\w+)</strong></p>' +    OFFLINE_PATTERN = r'(P|p)lik zosta. (usuni.ty|przeniesiony)'      LINK_FREE_PATTERN    = r'<a href="(.*?)" class="btn-upload-free">'      LINK_PREMIUM_PATTERN = r'<a href="(.*?)" class="btn-upload-premium">' @@ -33,7 +32,7 @@ class FileSharkPl(SimpleHoster):      IP_ERROR_PATTERN   = r'Strona jest dost.pna wy..cznie dla u.ytkownik.w znajduj.cych si. na terenie Polski'      SLOT_ERROR_PATTERN = r'Osi.gni.to maksymaln. liczb. .ci.ganych jednocze.nie plik.w\.' -    CAPTCHA_PATTERN = '<img src="data:image/jpeg;base64,(.*?)" title="captcha"' +    CAPTCHA_PATTERN = r'<img src="data:image/jpeg;base64,(.*?)" title="captcha"'      TOKEN_PATTERN   = r'name="form\[_token\]" value="(.*?)" />' @@ -80,7 +79,7 @@ class FileSharkPl(SimpleHoster):          link = urljoin("http://fileshark.pl", m.group(1)) -        self.html = self.load(link, decode=True) +        self.html = self.load(link)          m = re.search(self.WAIT_PATTERN, self.html)          if m: @@ -111,23 +110,6 @@ class FileSharkPl(SimpleHoster):          self.download(link, post=inputs, disposition=True) -    def checkFile(self): -        check = self.checkDownload({'wrong_captcha': re.compile(r'<label for="form_captcha" generated="true" class="error">(.*?)</label>'), -                                    'wait_pattern' : re.compile(self.SECONDS_PATTERN), -                                    'DL-found'     : re.compile('<a href="(.*)">')}) -        if check == "DL-found": -            self.correctCaptcha() - -        elif check == "wrong_captcha": -            self.invalidCaptcha() -            self.retry(10, 1, _("Wrong captcha solution")) - -        elif check == "wait_pattern": -            self.retry() - -        return super(FileSharkPl, self).checkFile() - -      def _decode64(self, data, *args, **kwargs):          return data.decode('base64') diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index b2c40a828..3a38c4eea 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -246,7 +246,7 @@ def secondsToMidnight(gmt=0):  class SimpleHoster(Hoster):      __name__    = "SimpleHoster"      __type__    = "hoster" -    __version__ = "1.19" +    __version__ = "1.20"      __pattern__ = r'^unmatchable$' @@ -516,6 +516,9 @@ class SimpleHoster(Hoster):              if hasattr(self, 'ERROR_PATTERN'):                  rules['error'] = re.compile(self.ERROR_PATTERN) +            if hasattr(self, 'WAIT_PATTERN'): +                rules['wait error'] = re.compile(self.WAIT_PATTERN) +              check = self.checkDownload(rules)              if check:  #@TODO: Move to hoster in 0.4.10                  errmsg = check.strip().capitalize() | 
