Repository: pyload/pyload

Issue:
[Pluginrequst] Hostuje.net
sample links: http://linkcrypt.ws/dir/v57uj31d30140bu

Problem: I cannot fetch the HTML. Just the adblock.php, will be delivered. I can reproduce it with browser if I deactivate javascript.

Would be very nice if this hoster could work :)

my current code, maybe something is useful.

```
# -*- coding: utf-8 -*-
#
# Test links:
# http://hostuje.net/file.php?id=ec1388ceafc1c8a4e4f6cc5e0d60a789

import re

from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo


class hostuje(SimpleHoster):
    __name__    = "Hostuje"
    __type__    = "hoster"
    __version__ = "0.01"

    __pattern__ = r'http://(?:www\.)?hostuje\.net/\w+'

    __description__ = """ Hostuje.net hoster plugin """
    __license__     = "GPLv3"
    __authors__     = [("sraedler", "")]


    NAME_PATTERN = r'<input type="hidden" name="name" value="(?P<N>(\w|\.)+)"'
    SIZE_PATTERN = r'<b>Rozmiar:</b> (?P<S>(\d)+) (?P<U>(\w)+)<br><b>Typ:'
    OFFLINE_PATTERN = r'>Podany plik nie zostal odnaleziony...'

    LINK_FREE_PATTERN = r'<form "'
    OK_PATTERN = r'<input type="hidden" name="OK" value="(\d+)"'
    HASZ_PATTERN = r'<input type="hidden" name="hasz" value="(\w+)"'
    ID_PATTERN = r'<input type="hidden" name="id" value="(\w+)"'
    MIME_PATTERN = r'<input type="hidden" name="mime" value="(\w|\\|/|-|\.)+"'
    K_PATTERN = r'<input type="hidden" name="k" value="(\w|\\|/|-|\.)+"'


    def setup(self):
        self.multiDL = True
        self.chunkLimit = 1


    def handleFree(self, pyfile):
        # Search for Download URL
        m = re.search(self.LINK_FREE_PATTERN, self.html)
        if m is None:
            self.error(_("LINK_FREE_PATTERN not found"))

        NAME = re.search(self.NAME_PATTERN, self.html)
        OK = re.search(self.OK_PATTERN, self.html)
        HASZ = re.search(self.HASZ_PATTERN, self.html)
        ID = re.search(self.ID_PATTERN, self.html)
        MIME = re.search(self.MIME_PATTERN, self.html)
        K = re.search(self.K_PATTERN, self.html)

        self.download(m.group(1),
                      post={'REG': OK.group(1),'OK': OK.group(1),'hasz': HASZ.group(1),'id':ID.group(1),'name': NAME.group(1),'mime': MIME.group(1),'k': K.group(1)})

getInfo = create_getInfo(hostuje)
```



Discussion:

Resolving patch:
diff --git a/module/plugins/hoster/HostujeNet.py b/module/plugins/hoster/HostujeNet.py
new file mode 100644
--- /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)


Test patch: