summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar zapp-brannigan <zapp-brannigan@users.noreply.github.com> 2015-04-11 11:23:36 +0200
committerGravatar zapp-brannigan <zapp-brannigan@users.noreply.github.com> 2015-04-11 11:23:36 +0200
commit20d433b55b40203a8f302a8ecd3c58b47c2869e3 (patch)
tree747c2d139d0edb34c0ffe2fafa030422ab3ced86 /module/plugins
parentFix OboomCom and SmoozedCom with beaker >= v1.7.x (diff)
downloadpyload-20d433b55b40203a8f302a8ecd3c58b47c2869e3.tar.xz
[New Hoster] lolabits.es
As requested in https://github.com/pyload/pyload/issues/1343
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hoster/LolabitsEs.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/module/plugins/hoster/LolabitsEs.py b/module/plugins/hoster/LolabitsEs.py
new file mode 100644
index 000000000..fe25aa838
--- /dev/null
+++ b/module/plugins/hoster/LolabitsEs.py
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*
+
+import re
+import HTMLParser
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+class LolabitsEs(SimpleHoster):
+ __name__ = "LolabitsEs"
+ __type__ = "hoster"
+ __version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?lolabits.es/.*'
+
+ __description__ = """lolabits.es hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")]
+
+
+ NAME_PATTERN = r'Descargar: <b>(?P<N>.+?)</b>'
+ SIZE_PATTERN = r'class="fileSize">(?P<S>[\d.,]+) (?P<U>[\w^_]+)<'
+
+ OFFLINE_PATTERN = r'Un usuario con este nombre no existe'
+
+
+ def setup(self):
+ self.chunkLimit = 1
+
+ def handleFree(self, pyfile):
+ fileid = re.search(r'name="FileId" value="(\d+)"',self.html).group(1)
+ self.logDebug("FileID: %s" %fileid)
+
+ token = re.search(r'name="__RequestVerificationToken" type="hidden" value="(.+?)"',self.html).group(1)
+ self.logDebug("Token: %s" %token)
+
+ self.html = self.load("http://lolabits.es/action/License/Download",
+ cookies = True,
+ post = {"fileId" : fileid,
+ "__RequestVerificationToken" : token}
+ ).decode('unicode-escape')
+ m = re.search(r'"redirectUrl":"(.+?)"',self.html)
+ self.link = HTMLParser.HTMLParser().unescape(m.group(1))
+
+
+getInfo = create_getInfo(LolabitsEs)