summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-16 00:36:21 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-16 00:36:21 +0200
commitd27fa4fe69a250c254dcd533fe83ad7dd07680bd (patch)
tree676925aaada1fcf8302027b4dbfca8bcb20ae8e5
parentMerge pull request #1355 from GammaC0de/stable (diff)
parentHostujeNet (diff)
downloadpyload-d27fa4fe69a250c254dcd533fe83ad7dd07680bd.tar.xz
Merge pull request #1358 from GammaC0de/GammaC0de-HostujeNet
[New Hoster] 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)