summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-02-03 00:47:08 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-02-03 00:47:08 +0100
commitd4751c2d0797796af14c4a8ab0746eba91cebc99 (patch)
tree2d2f4a7f027d6fc5697fd08e70965bb02c58d775 /module/plugins/accounts
parentfix linkdecrypter hook, add 115.com (diff)
downloadpyload-d4751c2d0797796af14c4a8ab0746eba91cebc99.tar.xz
fix ul.to
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/FilejungleCom.py4
-rw-r--r--module/plugins/accounts/YibaishiwuCom.py51
2 files changed, 53 insertions, 2 deletions
diff --git a/module/plugins/accounts/FilejungleCom.py b/module/plugins/accounts/FilejungleCom.py
index 4fa4a06d8..8ac25c201 100644
--- a/module/plugins/accounts/FilejungleCom.py
+++ b/module/plugins/accounts/FilejungleCom.py
@@ -23,7 +23,7 @@ from time import mktime, strptime
class FilejungleCom(Account):
__name__ = "FilejungleCom"
- __version__ = "0.1"
+ __version__ = "0.11"
__type__ = "account"
__description__ = """filejungle.com account plugin"""
__author_name__ = ("zoidberg")
@@ -40,7 +40,7 @@ class FilejungleCom(Account):
found = re.search(self.TRAFFIC_LEFT_PATTERN, html)
if found:
premium = True
- validuntil = mktime(strptime(found.group(1), "%d %B %Y"))
+ validuntil = mktime(strptime(found.group(1), "%d %b %Y"))
else:
premium = False
validuntil = -1
diff --git a/module/plugins/accounts/YibaishiwuCom.py b/module/plugins/accounts/YibaishiwuCom.py
new file mode 100644
index 000000000..e2aa6f11d
--- /dev/null
+++ b/module/plugins/accounts/YibaishiwuCom.py
@@ -0,0 +1,51 @@
+# -*- 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
+"""
+
+from module.plugins.Account import Account
+import re
+
+class YibaishiwuCom(Account):
+ __name__ = "YibaishiwuCom"
+ __version__ = "0.01"
+ __type__ = "account"
+ __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)
+ return dict({"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium})
+
+ def login(self, user, data, req):
+ html = req.load('http://passport.115.com/?ac=login', post = {
+ "back": "http://www.115.com/",
+ "goto": "http://115.com/",
+ "login[account]": user,
+ "login[passwd]": data['password']
+ }, decode = True)
+
+ if not 'var USER_PERMISSION = {' in html:
+ self.wrongPassword() \ No newline at end of file