diff options
Diffstat (limited to 'module/plugins/hoster')
| -rw-r--r-- | module/plugins/hoster/BayfilesCom.py | 19 | ||||
| -rw-r--r-- | module/plugins/hoster/HellshareCz.py | 11 | 
2 files changed, 17 insertions, 13 deletions
| diff --git a/module/plugins/hoster/BayfilesCom.py b/module/plugins/hoster/BayfilesCom.py index c771f28c6..e2c74e5c0 100644 --- a/module/plugins/hoster/BayfilesCom.py +++ b/module/plugins/hoster/BayfilesCom.py @@ -26,7 +26,7 @@ class BayfilesCom(SimpleHoster):      __name__ = "BayfilesCom"      __type__ = "hoster"      __pattern__ = r"http://(?:www\.)?bayfiles\.com/file/\w+/\w+/.*" -    __version__ = "0.01" +    __version__ = "0.02"      __description__ = """Bayfiles.com plugin - free only"""      __author_name__ = ("zoidberg")      __author_mail__ = ("zoidberg@mujmail.cz") @@ -37,7 +37,8 @@ class BayfilesCom(SimpleHoster):      WAIT_PATTERN = r'>Your IP [0-9.]* has recently downloaded a file\. Upgrade to premium or wait (\d+) minutes\.<'      VARS_PATTERN = r'var vfid = (\d+);\s*var delay = (\d+);'      LINK_PATTERN = r"javascript:window.location.href = '([^']+)';" - +    PREMIUM_LINK_PATTERN = r'(?:<a class="highlighted-btn" href="|(?=http://s\d+\.baycdn\.com/dl/))(.*?)"' +          def handleFree(self):          found = re.search(self.WAIT_PATTERN, self.html)          if found: @@ -69,9 +70,15 @@ class BayfilesCom(SimpleHoster):          # Get final link and download                  found = re.search(self.LINK_PATTERN, self.html)          if not found: self.parseError("Free link") -        url = found.group(1) -        self.logDebug("URL: " + url) - -        self.download(url) +        self.startDownload(found.group(1)) +         +    def handlePremium(self):    +        found = re.search(self.PREMIUM_LINK_PATTERN, self.html) +        if not found: self.parseError("Premium link") +        self.startDownload(found.group(1)) +             +    def startDownload(self, url): +        self.logDebug("%s URL: %s" % ("Premium" if self.premium else "Free", url)) +        self.download(url)          getInfo = create_getInfo(BayfilesCom)
\ No newline at end of file diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py index cc8341f8e..0add79ed9 100644 --- a/module/plugins/hoster/HellshareCz.py +++ b/module/plugins/hoster/HellshareCz.py @@ -26,7 +26,7 @@ class HellshareCz(SimpleHoster):      __name__ = "HellshareCz"      __type__ = "hoster"      __pattern__ = r"(http://(?:.*\.)*hellshare\.(?:cz|com|sk|hu)/[^?]*/\d+).*" -    __version__ = "0.76" +    __version__ = "0.77"      __description__ = """Hellshare.cz"""      __author_name__ = ("zoidberg") @@ -46,18 +46,15 @@ class HellshareCz(SimpleHoster):          self.chunkLimit = 1      def process(self, pyfile): -        if self.account: -            self.account.relogin(self.user) -          pyfile.url = re.search(self.__pattern__, pyfile.url).group(1)          self.html = self.load(pyfile.url, decode = True)          self.getFileInfo()          found = re.search(self.SHOW_WINDOW_PATTERN, self.html)          if not found: self.parseError('SHOW WINDOW') -        url = found.group(1)         -        self.logDebug("SHOW WINDOW: " + url) -        self.html = self.load("http://download.hellshare.com" + url, decode=True) +        self.url = "http://www.hellshare.com" + found.group(1)         +        self.logDebug("SHOW WINDOW: " + self.url) +        self.html = self.load(self.url, decode=True)          if self.account:              self.handlePremium() | 
