diff options
Diffstat (limited to 'module')
| -rw-r--r-- | module/plugins/internal/SimpleHoster.py | 11 | 
1 files changed, 7 insertions, 4 deletions
| diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 47fded260..46d0a9517 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -163,7 +163,7 @@ class PluginParseError(Exception):  class SimpleHoster(Hoster):      __name__ = "SimpleHoster" -    __version__ = "0.32" +    __version__ = "0.33"      __pattern__ = None      __type__ = "hoster"      __description__ = """Base hoster plugin""" @@ -202,14 +202,17 @@ class SimpleHoster(Hoster):          # Due to a 0.4.9 core bug self.load would keep previous cookies even if overridden by cookies parameter.          # Workaround using getURL. Can be reverted in 0.5 as the cookies bug has been fixed.          self.html = getURL(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES) -        self.getFileInfo() +        premium_only = hasattr(self, 'PREMIUM_ONLY_PATTERN') and re.search(self.PREMIUM_ONLY_PATTERN, self.html) +        if not premium_only:  # Usually premium only pages doesn't show the file information +            self.getFileInfo() +          if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()):              self.handlePremium() +        elif premium_only: +            self.fail("This link require a premium account")          else:              # This line is required due to the getURL workaround. Can be removed in 0.5              self.html = self.load(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES) -            if hasattr(self, 'PREMIUM_ONLY_PATTERN') and re.search(self.PREMIUM_ONLY_PATTERN, self.html): -                self.fail("This link require a premium account")              self.handleFree()      def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False, decode=False): | 
