diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 10:46:28 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 10:46:28 +0100 |
commit | ce1c2b6b05c08b669357947e61ae40efce7fc50f (patch) | |
tree | 0b5f7996960cf35c4eface53a89eba18a37519b7 /pyload/plugin/account/CatShareNet.py | |
parent | Fix filename case (diff) | |
download | pyload-ce1c2b6b05c08b669357947e61ae40efce7fc50f.tar.xz |
module temp
Diffstat (limited to 'pyload/plugin/account/CatShareNet.py')
-rw-r--r-- | pyload/plugin/account/CatShareNet.py | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/pyload/plugin/account/CatShareNet.py b/pyload/plugin/account/CatShareNet.py deleted file mode 100644 index 4c1cd00d7..000000000 --- a/pyload/plugin/account/CatShareNet.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import mktime, strptime - -from pyload.plugin.Account import Account - - -class CatShareNet(Account): - __name__ = "CatShareNet" - __type__ = "account" - __version__ = "0.01" - - __description__ = """CatShareNet account plugin""" - __license__ = "GPLv3" - __authors__ = [("prOq", "")] - - - PREMIUM_PATTERN = r'class="nav-collapse collapse pull-right">[\s\w<>=-."/:]*\sz.</a></li>\s*<li><a href="/premium">.*\s*<span style="color: red">(.*?)</span>[\s\w<>/]*href="/logout"' - VALID_UNTIL_PATTERN = r'<div class="span6 pull-right">[\s\w<>=-":;]*<span style="font-size:13px;">.*?<strong>(.*?)</strong></span>' - - - def loadAccountInfo(self, user, req): - premium = False - validuntil = -1 - - html = req.load("http://catshare.net/", decode=True) - - try: - m = re.search(self.PREMIUM_PATTERN, html) - if "Premium" in m.group(1): - premium = True - except Exception: - pass - - try: - m = re.search(self.VALID_UNTIL_PATTERN, html) - expiredate = m.group(1) - if "-" not in expiredate: - validuntil = mktime(strptime(expiredate, "%d.%m.%Y")) - except Exception: - pass - - return {'premium': premium, 'trafficleft': -1, 'validuntil': validuntil} - - - def login(self, user, data, req): - html = req.load("http://catshare.net/login", - post={'user_email': user, - 'user_password': data['password'], - 'remindPassword': 0, - 'user[submit]': "Login"}) - - if not '<a href="/logout">Wyloguj</a>' in html: - self.wrongPassword() |