diff options
author | Stefano <l.stickell@yahoo.it> | 2013-07-22 20:50:34 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-07-22 20:50:34 +0200 |
commit | 2edeee0532ec6d6b4b26fd045a5971f67ca455da (patch) | |
tree | 8d656afc9c18f7dba7c05d6635f898fdf58d66d6 /module/plugins/hoster/WarserverCz.py | |
parent | Fixed PEP 8 violations in Crypters (diff) | |
download | pyload-2edeee0532ec6d6b4b26fd045a5971f67ca455da.tar.xz |
Fixed PEP 8 violations in Hosters
Diffstat (limited to 'module/plugins/hoster/WarserverCz.py')
-rw-r--r-- | module/plugins/hoster/WarserverCz.py | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/module/plugins/hoster/WarserverCz.py b/module/plugins/hoster/WarserverCz.py index b256f8d1b..ee580fbdd 100644 --- a/module/plugins/hoster/WarserverCz.py +++ b/module/plugins/hoster/WarserverCz.py @@ -23,6 +23,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.network.HTTPRequest import BadHeader from module.utils import html_unescape + class WarserverCz(SimpleHoster): __name__ = "WarserverCz" __type__ = "hoster" @@ -30,41 +31,45 @@ class WarserverCz(SimpleHoster): __version__ = "0.12" __description__ = """Warserver.cz""" __author_name__ = ("zoidberg") - + FILE_NAME_PATTERN = r'<h1.*?>(?P<N>[^<]+)</h1>' FILE_SIZE_PATTERN = r'<li>Velikost: <strong>(?P<S>[^<]+)</strong>' FILE_OFFLINE_PATTERN = r'<h1>Soubor nenalezen</h1>' - + PREMIUM_URL_PATTERN = r'href="(http://[^/]+/dwn-premium.php.*?)"' DOMAIN = "http://csd01.coolshare.cz" - - DOMAIN = "http://s01.warserver.cz" - + + DOMAIN = "http://s01.warserver.cz" + def handleFree(self): - try: - self.download("%s/dwn-free.php?fid=%s" % (self.DOMAIN, self.file_info['ID'])) + try: + self.download("%s/dwn-free.php?fid=%s" % (self.DOMAIN, self.file_info['ID'])) except BadHeader, e: self.logError(e) if e.code == 403: - self.longWait(60,60) - else: raise + self.longWait(60, 60) + else: + raise self.checkDownloadedFile() - + def handlePremium(self): found = re.search(self.PREMIUM_URL_PATTERN, self.html) - if not found: self.parseError("Premium URL") + if not found: + self.parseError("Premium URL") url = html_unescape(found.group(1)) - self.logDebug("Premium URL: " + url) - if not url.startswith("http://"): self.resetAccount() + self.logDebug("Premium URL: " + url) + if not url.startswith("http://"): + self.resetAccount() self.download(url) - self.checkDownloadedFile() - + self.checkDownloadedFile() + def checkDownloadedFile(self): check = self.checkDownload({ "offline": ">404 Not Found<" - }) + }) if check == "offline": - self.offline() + self.offline() + -getInfo = create_getInfo(WarserverCz)
\ No newline at end of file +getInfo = create_getInfo(WarserverCz) |