summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar GammaC0de <GammaC0de@users.noreply.github.com> 2015-04-16 00:29:39 +0200
committerGravatar GammaC0de <GammaC0de@users.noreply.github.com> 2015-04-16 00:29:39 +0200
commit6b271a669cd4b08cdbd8d55d9b3b4f6deec7c8ac (patch)
tree676925aaada1fcf8302027b4dbfca8bcb20ae8e5
parentVersion bump (diff)
downloadpyload-6b271a669cd4b08cdbd8d55d9b3b4f6deec7c8ac.tar.xz
HostujeNet
-rw-r--r--module/plugins/hoster/HostujeNet.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/module/plugins/hoster/HostujeNet.py b/module/plugins/hoster/HostujeNet.py
new file mode 100644
index 000000000..2dabb72d2
--- /dev/null
+++ b/module/plugins/hoster/HostujeNet.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+#
+
+
+import re
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+class HostujeNet(SimpleHoster):
+ __name__ = "HostujeNet"
+ __type__ = "hoster"
+ __version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?hostuje\.net/\w+'
+
+ __description__ = """Hostuje.net hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("GammaC0de", None)]
+
+
+ NAME_PATTERN = r'<input type="hidden" name="name" value="(?P<N>.+?)">'
+ SIZE_PATTERN = r'<b>Rozmiar:</b> (?P<S>[\d.,]+) (?P<U>[\w^_]+)<br>'
+ OFFLINE_PATTERN = ur'Podany plik nie został odnaleziony\.\.\.'
+
+
+ def setup(self):
+ self.multiDL = True
+ self.chunkLimit = 1
+
+
+ def handleFree(self, pyfile):
+ m = re.search(r'<script src="([\w^_]+.php)"></script>', self.html)
+ if m:
+ jscript = self.load("http://hostuje.net/" + m.group(1))
+ m = re.search(r"\('(\w+\.php\?i=\w+)'\);", jscript)
+ if m:
+ self.load("http://hostuje.net/" + m.group(1))
+ else:
+ self.error(_("unexpected javascript format"))
+ else:
+ self.error(_("script not found"))
+
+ action, inputs = self.parseHtmlForm(pyfile.url.replace(".", "\.").replace( "?", "\?"))
+ if not action:
+ self.error(_("form not found"))
+
+ self.download(action, post=inputs)
+
+
+getInfo = create_getInfo(HostujeNet)