diff options
| author | 2015-04-13 10:21:32 +0200 | |
|---|---|---|
| committer | 2015-04-13 10:21:32 +0200 | |
| commit | eca20b701c411046e7ededb0462b310124ce3c18 (patch) | |
| tree | c5eb36261cfc935f001b816f28f15d1f5afbf7e0 /pyload/plugin/hoster/LolabitsEs.py | |
| parent | Merge branch 'stable' into 0.4.10 (diff) | |
| download | pyload-eca20b701c411046e7ededb0462b310124ce3c18.tar.xz | |
Cleanup + fixup + new lib
Diffstat (limited to 'pyload/plugin/hoster/LolabitsEs.py')
| -rw-r--r-- | pyload/plugin/hoster/LolabitsEs.py | 45 | 
1 files changed, 45 insertions, 0 deletions
| diff --git a/pyload/plugin/hoster/LolabitsEs.py b/pyload/plugin/hoster/LolabitsEs.py new file mode 100644 index 000000000..dbd392624 --- /dev/null +++ b/pyload/plugin/hoster/LolabitsEs.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -* + +import HTMLParser +import re + +from pyload.plugin.internal.SimpleHoster import SimpleHoster + + +class LolabitsEs(SimpleHoster): +    __name__    = "LolabitsEs" +    __type__    = "hoster" +    __version__ = "0.02" + +    __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>.+?)<' +    SIZE_PATTERN    = r'class="fileSize">(?P<S>[\d.,]+) (?P<U>[\w^_]+)' +    OFFLINE_PATTERN = r'Un usuario con este nombre no existe' + +    FILEID_PATTERN = r'name="FileId" value="(\d+)"' +    TOKEN_PATTERN  = r'name="__RequestVerificationToken" type="hidden" value="(.+?)"' +    LINK_PATTERN   = r'"redirectUrl":"(.+?)"' + + +    def setup(self): +        self.chunkLimit = 1 + + +    def handleFree(self, pyfile): +        fileid = re.search(self.FILEID_PATTERN, self.html).group(1) +        self.logDebug("FileID: " + fileid) + +        token = re.search(self.TOKEN_PATTERN, self.html).group(1) +        self.logDebug("Token: " + token) + +        self.html = self.load("http://lolabits.es/action/License/Download", +                              post={'fileId'                     : fileid, +                                    '__RequestVerificationToken' : token}).decode('unicode-escape') + +        self.link = HTMLParser.HTMLParser().unescape(re.search(self.LINK_PATTERN, self.html).group(1)) | 
