diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2011-11-22 00:26:08 +0100 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2011-11-22 00:26:08 +0100 |
commit | 9378237ddc39f8ee96e7a3ddb9cc37ce487c5f4d (patch) | |
tree | 325aba4194c29ee7869f662e1b8f8b5015afd283 /module/plugins/hoster/HellshareCz.py | |
parent | SimpleHoster fix (diff) | |
download | pyload-9378237ddc39f8ee96e7a3ddb9cc37ce487c5f4d.tar.xz |
fix filepost (#431), hellspy, ifolder, letitbit, change SimpleHoster patterns
Diffstat (limited to 'module/plugins/hoster/HellshareCz.py')
-rw-r--r-- | module/plugins/hoster/HellshareCz.py | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py index c969d3285..cc8341f8e 100644 --- a/module/plugins/hoster/HellshareCz.py +++ b/module/plugins/hoster/HellshareCz.py @@ -18,30 +18,22 @@ import re import datetime -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo +from math import ceil +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.network.RequestFactory import getURL -def getInfo(urls): - result = [] - - for url in urls: - file_info = parseFileInfo(HellshareCz, url, getURL(url, decode=True)) - result.append(file_info) - - yield result - class HellshareCz(SimpleHoster): __name__ = "HellshareCz" __type__ = "hoster" __pattern__ = r"(http://(?:.*\.)*hellshare\.(?:cz|com|sk|hu)/[^?]*/\d+).*" - __version__ = "0.75" + __version__ = "0.76" __description__ = """Hellshare.cz""" __author_name__ = ("zoidberg") FREE_URL_PATTERN = r'<form[^>]*action="(http://free\d*\.helldata[^"]*)"' PREMIUM_URL_PATTERN = r"launchFullDownload\('([^']*)'\);" - FILE_NAME_PATTERN = r'<h1 id="filename">([^<]+)</h1>' - FILE_SIZE_PATTERN = r'<td><span>Size</span></td>\s*<th><span>([0-9.]*) (kB|KB|MB|GB)</span></th>' + FILE_NAME_PATTERN = r'<h1 id="filename">(?P<N>[^<]+)</h1>' + FILE_SIZE_PATTERN = r'<td><span>Size</span></td>\s*<th><span>(?P<S>[0-9.]*) (?P<U>[kKMG])i?B</span></th>' FILE_OFFLINE_PATTERN = r'<h1>File not found.</h1>' CAPTCHA_PATTERN = r'<img class="left" id="captcha-img"src="([^"]*)" />' #FILE_CREDITS_PATTERN = r'<strong class="filesize">(\d+) MB</strong>' @@ -128,4 +120,6 @@ class HellshareCz(SimpleHoster): self.download(download_url) info = self.account.getAccountInfo(self.user, True) - self.logInfo("User %s has %i credits left" % (self.user, info["trafficleft"] / 1024))
\ No newline at end of file + self.logInfo("User %s has %i credits left" % (self.user, info["trafficleft"] / 1024)) + +getInfo = create_getInfo(HellshareCz)
\ No newline at end of file |