summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/YibaishiwuCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/YibaishiwuCom.py')
-rw-r--r--module/plugins/accounts/YibaishiwuCom.py27
1 files changed, 6 insertions, 21 deletions
diff --git a/module/plugins/accounts/YibaishiwuCom.py b/module/plugins/accounts/YibaishiwuCom.py
index 75aae25b9..be62d3f40 100644
--- a/module/plugins/accounts/YibaishiwuCom.py
+++ b/module/plugins/accounts/YibaishiwuCom.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License,
- or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-
- @author: zoidberg
-"""
-
import re
from module.plugins.Account import Account
@@ -24,21 +7,23 @@ from module.plugins.Account import Account
class YibaishiwuCom(Account):
__name__ = "YibaishiwuCom"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """115.com account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
ACCOUNT_INFO_PATTERN = r'var USER_PERMISSION = {(.*?)}'
+
def loadAccountInfo(self, user, req):
#self.relogin(user)
html = req.load("http://115.com/", decode=True)
- found = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S)
- premium = True if (found and 'is_vip: 1' in found.group(1)) else False
- validuntil = trafficleft = (-1 if found else 0)
+ m = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S)
+ premium = True if (m and 'is_vip: 1' in m.group(1)) else False
+ validuntil = trafficleft = (-1 if m else 0)
return dict({"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium})
def login(self, user, data, req):