diff options
Diffstat (limited to 'module/plugins')
| -rw-r--r-- | module/plugins/accounts/FastshareCz.py | 1 | ||||
| -rw-r--r-- | module/plugins/accounts/FreakshareCom.py | 1 | ||||
| -rw-r--r-- | module/plugins/accounts/NowVideoAt.py | 56 | ||||
| -rw-r--r-- | module/plugins/hoster/NowVideoAt.py | 11 | 
4 files changed, 64 insertions, 5 deletions
| diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py index ff437c101..c6dc7070b 100644 --- a/module/plugins/accounts/FastshareCz.py +++ b/module/plugins/accounts/FastshareCz.py @@ -1,6 +1,7 @@  # -*- coding: utf-8 -*-  import re +  from module.plugins.Account import Account diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index 6f895edd2..27e1e3a0a 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -1,6 +1,7 @@  # -*- coding: utf-8 -*-  import re +  from time import strptime, mktime  from module.plugins.Account import Account diff --git a/module/plugins/accounts/NowVideoAt.py b/module/plugins/accounts/NowVideoAt.py new file mode 100644 index 000000000..234984b6b --- /dev/null +++ b/module/plugins/accounts/NowVideoAt.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +import re + +from time import gmtime, mktime, strptime + +from module.plugins.Account import Account + + +class NowVideoAt(Account): +    __name__    = "NowVideoAt" +    __type__    = "account" +    __version__ = "0.01" + +    __description__ = """NowVideo.at account plugin""" +    __license__     = "GPLv3" +    __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] + + +    VALID_UNTIL_PATTERN = r'>Your premium membership expires on: (.+?)<' + + +    def loadAccountInfo(self, user, req): +        validuntil  = None +        trafficleft = -1 +        premium     = None + +        html = req.load("http://www.nowvideo.at/premium.php") + +        m = re.search(self.VALID_UNTIL_PATTERN, html) +        if m: +            expiredate = m.group(1).strip() +            self.logDebug("Expire date: " + expiredate) + +            try: +                validuntil = mktime(strptime(expiredate, "%Y-%b-%d")) + +            except Exception, e: +                self.logError(e) + +            else: +                if validuntil > mktime(gmtime()): +                    premium = True +                else: +                    premium = False +                    validuntil = -1 + +        return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + + +    def login(self, user, data, req): +        html = req.load("http://www.nowvideo.at/login.php", +                        post={'user': user, 'pass': data['password']}) + +        if ">Invalid login details" is html: +            self.wrongPassword() diff --git a/module/plugins/hoster/NowVideoAt.py b/module/plugins/hoster/NowVideoAt.py index bcf3165d2..53d782d06 100644 --- a/module/plugins/hoster/NowVideoAt.py +++ b/module/plugins/hoster/NowVideoAt.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo  class NowVideoAt(SimpleHoster):      __name__    = "NowVideoAt"      __type__    = "hoster" -    __version__ = "0.04" +    __version__ = "0.05"      __pattern__ = r'http://(?:www\.)?nowvideo\.(at|ch|co|eu|sx)/(video|mobile/#/videos)/(?P<ID>\w+)' @@ -22,7 +22,8 @@ class NowVideoAt(SimpleHoster):      NAME_PATTERN = r'<h4>(?P<N>.+?)<'      OFFLINE_PATTERN = r'>This file no longer exists' -    LINK_PATTERN = r'<source src="(.+?)"' +    LINK_FREE_PATTERN = r'<source src="(.+?)"' +    LINK_PREMIUM_PATTERN = r'<div id="content_player" >\s*<a href="(.+?)"'      def setup(self): @@ -33,11 +34,11 @@ class NowVideoAt(SimpleHoster):      def handleFree(self):          self.html = self.load("http://www.nowvideo.at/mobile/video.php", get={'id': self.info['ID']}) -        m = re.search(self.LINK_PATTERN, self.html) +        m = re.search(self.LINK_FREE_PATTERN, self.html)          if m is None: -            self.error(_("Download link not found")) +            self.error(_("Free download link not found")) -        self.download(m.group(1), disposition=True) +        self.download(m.group(1))  getInfo = create_getInfo(NowVideoAt) | 
