summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/hoster/WarserverCz.py73
1 files changed, 6 insertions, 67 deletions
diff --git a/module/plugins/hoster/WarserverCz.py b/module/plugins/hoster/WarserverCz.py
index 1a3a707b7..73c5b6bc7 100644
--- a/module/plugins/hoster/WarserverCz.py
+++ b/module/plugins/hoster/WarserverCz.py
@@ -1,77 +1,16 @@
# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License,
- or (at your option) any later version.
+from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-
- @author: zoidberg
-"""
-
-#similar to coolshare.cz (down)
-
-import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.network.HTTPRequest import BadHeader
-from module.utils import html_unescape
-
-
-class WarserverCz(SimpleHoster):
+class WarserverCz(DeadHoster):
__name__ = "WarserverCz"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?warserver.cz/stahnout/(?P<ID>\d+)/.+'
- __version__ = "0.12"
+ __pattern__ = r'http://(?:www\.)?warserver\.cz/stahnout/\d+'
+ __version__ = "0.13"
__description__ = """Warserver.cz hoster plugin"""
- __author_name__ = "zoidberg"
- __author_mail__ = "zoidberg@mujmail.cz"
-
- FILE_NAME_PATTERN = r'<h1.*?>(?P<N>[^<]+)</h1>'
- FILE_SIZE_PATTERN = r'<li>Velikost: <strong>(?P<S>[^<]+)</strong>'
- 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"
-
- def handleFree(self):
- 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.checkDownloadedFile()
-
- def handlePremium(self):
- found = re.search(self.PREMIUM_URL_PATTERN, self.html)
- 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.download(url)
- self.checkDownloadedFile()
-
- def checkDownloadedFile(self):
- check = self.checkDownload({
- "offline": ">404 Not Found<"
- })
-
- if check == "offline":
- self.offline()
+ __author_name__ = "Walter Purcaro"
+ __author_mail__ = "vuolter@gmail.com"
getInfo = create_getInfo(WarserverCz)