diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-11-19 21:05:07 +0100 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-11-19 21:05:07 +0100 |
commit | b374213e3fe9b6573a4fc4146480724ac2c56f2e (patch) | |
tree | b35a3358f18bf1673545693c3d92c52b0b47efa3 /module/plugins/hoster/HellshareCz.py | |
parent | Dereferer plugin (diff) | |
download | pyload-b374213e3fe9b6573a4fc4146480724ac2c56f2e.tar.xz |
Update hellshare.cz, add boltsharing.com
Diffstat (limited to 'module/plugins/hoster/HellshareCz.py')
-rw-r--r-- | module/plugins/hoster/HellshareCz.py | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py index fd9f2ac32..aa494e34e 100644 --- a/module/plugins/hoster/HellshareCz.py +++ b/module/plugins/hoster/HellshareCz.py @@ -25,17 +25,13 @@ class HellshareCz(SimpleHoster): __name__ = "HellshareCz" __type__ = "hoster" __pattern__ = r"(http://(?:.*\.)*hellshare\.(?:cz|com|sk|hu|pl)/[^?]*/\d+).*" - __version__ = "0.81" + __version__ = "0.82" __description__ = """Hellshare.cz - premium only""" __author_name__ = ("zoidberg") - PREMIUM_URL_PATTERN = r"launchFullDownload\('([^']*)'\);" FILE_NAME_PATTERN = r'<h1 id="filename"[^>]*>(?P<N>[^<]+)</h1>' FILE_SIZE_PATTERN = r'<strong id="FileSize_master">(?P<S>[0-9.]*) (?P<U>[kKMG])i?B</strong>' FILE_OFFLINE_PATTERN = r'<h1>File not found.</h1>' - #FILE_CREDITS_PATTERN = r'<strong class="filesize">(\d+) MB</strong>' - CREDIT_LEFT_PATTERN = r'<th>(\d+)</th><td>credits' - DOWNLOAD_AGAIN_PATTERN = r'<p>This file you downloaded already and re-download is for free. </p>' SHOW_WINDOW_PATTERN = r'<a href="([^?]+/(\d+)/\?do=(fileDownloadButton|relatedFileDownloadButton-\2)-showDownloadWindow)"' def setup(self): @@ -47,25 +43,14 @@ class HellshareCz(SimpleHoster): pyfile.url = re.search(self.__pattern__, pyfile.url).group(1) self.html = self.load(pyfile.url, decode = True) self.getFileInfo() + if not self.checkTrafficLeft(): + self.fail("Not enough traffic left for user %s." % self.user) found = re.search(self.SHOW_WINDOW_PATTERN, self.html) if not found: self.parseError('SHOW WINDOW') self.url = "http://www.hellshare.com" + found.group(1) self.logDebug("DOWNLOAD URL: " + self.url) - # check credit - if self.DOWNLOAD_AGAIN_PATTERN in self.html: - self.logInfo("Downloading again for free") - else: - found = re.search(self.CREDIT_LEFT_PATTERN, self.html) - credits_left = int(found.group(1)) if found else (self.account.getAccountInfo(self.user, True)["trafficleft"] / 1024) - file_credits = ceil(self.pyfile.size / float(1024 ** 2)) - - if credits_left < file_credits: - self.fail("Not enough credit left for user %s: %d (%d needed)." % (self.user, credits_left, file_credits)) - else: - self.logInfo("Downloading file for %d credits, %d credits left" % (file_credits, credits_left)) - self.download(self.url) getInfo = create_getInfo(HellshareCz) |