diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-03-06 01:45:19 +0100 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-03-06 01:45:19 +0100 |
commit | 87069d00c9489fc7b885d9148f308e7f24f5f20b (patch) | |
tree | e8eb8c16674f37e95bf3f5c814916e6852bea885 /module/plugins/hoster/BayfilesCom.py | |
parent | share-online.biz (#550) partial fix, closed #551 (diff) | |
download | pyload-87069d00c9489fc7b885d9148f308e7f24f5f20b.tar.xz |
bayfiles.com premium, fix hellshare.cz
Diffstat (limited to 'module/plugins/hoster/BayfilesCom.py')
-rw-r--r-- | module/plugins/hoster/BayfilesCom.py | 19 |
1 files changed, 13 insertions, 6 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 |