diff options
Diffstat (limited to 'module')
| -rw-r--r-- | module/plugins/hoster/LolabitsEs.py | 44 | 
1 files changed, 23 insertions, 21 deletions
diff --git a/module/plugins/hoster/LolabitsEs.py b/module/plugins/hoster/LolabitsEs.py index fe25aa838..61df5f0bb 100644 --- a/module/plugins/hoster/LolabitsEs.py +++ b/module/plugins/hoster/LolabitsEs.py @@ -1,7 +1,7 @@  # -*- coding: utf-8 -* -import re  import HTMLParser +import re  from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -9,38 +9,40 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo  class LolabitsEs(SimpleHoster):      __name__    = "LolabitsEs"      __type__    = "hoster" -    __version__ = "0.01" +    __version__ = "0.02" -    __pattern__ = r'https?://(?:www\.)?lolabits.es/.*' +    __pattern__ = r'https?://(?:www\.)?lolabits\.es/.+' -    __description__ = """lolabits.es hoster plugin""" +    __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^_]+)<' -     +    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(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) -         +        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", -                              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)) -         -         +                              post={'fileId'                     : fileid, +                                    '__RequestVerificationToken' : token}).decode('unicode-escape') + +        self.link = HTMLParser.HTMLParser().unescape(re.search(self.LINK_PATTERN, self.html).group(1)) + +  getInfo = create_getInfo(LolabitsEs)  | 
