summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/RapiduNet.py
diff options
context:
space:
mode:
authorGravatar lazlev <lazlev@yopmail.com> 2015-08-09 00:50:54 +0200
committerGravatar lazlev <lazlev@yopmail.com> 2015-08-09 00:50:54 +0200
commitb0ef3f1673e1930916604bb1264ca3a38414bc8d (patch)
treec97936e4d2a4cd6eb1072c65c8a08a7d18816b18 /module/plugins/accounts/RapiduNet.py
parent[XFileSharingPro][XFileSharingProFolder] Added default __pattern__ (diff)
parentFix https://github.com/pyload/pyload/issues/1707 (diff)
downloadpyload-b0ef3f1673e1930916604bb1264ca3a38414bc8d.tar.xz
Merge pull request #1 from pyload/stable
sync with stable
Diffstat (limited to 'module/plugins/accounts/RapiduNet.py')
-rw-r--r--module/plugins/accounts/RapiduNet.py37
1 files changed, 19 insertions, 18 deletions
diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py
index 70f47b673..1ec29bd77 100644
--- a/module/plugins/accounts/RapiduNet.py
+++ b/module/plugins/accounts/RapiduNet.py
@@ -3,14 +3,15 @@
import re
import time
-from module.plugins.Account import Account
+from module.plugins.internal.Account import Account
from module.common.json_layer import json_loads
class RapiduNet(Account):
__name__ = "RapiduNet"
__type__ = "account"
- __version__ = "0.05"
+ __version__ = "0.07"
+ __status__ = "testing"
__description__ = """Rapidu.net account plugin"""
__license__ = "GPLv3"
@@ -25,12 +26,12 @@ class RapiduNet(Account):
TRAFFIC_LEFT_PATTERN = r'class="tipsyS"><b>(.+?)<'
- def loadAccountInfo(self, user, req):
+ def parse_info(self, user, password, data, req):
validuntil = None
trafficleft = -1
premium = False
- html = req.load("https://rapidu.net/", decode=True)
+ html = self.load("https://rapidu.net/")
if re.search(self.PREMIUM_PATTERN, html):
premium = True
@@ -41,25 +42,25 @@ class RapiduNet(Account):
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
if m:
- trafficleft = self.parseTraffic(m.group(1))
+ trafficleft = self.parse_traffic(m.group(1))
return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium}
- def login(self, user, data, req):
- req.load("https://rapidu.net/ajax.php",
- get={'a': "getChangeLang"},
- post={'_go' : "",
- 'lang': "en"})
+ def login(self, user, password, data, req):
+ self.load("https://rapidu.net/ajax.php",
+ get={'a': "getChangeLang"},
+ post={'_go' : "",
+ 'lang': "en"})
- json = json_loads(req.load("https://rapidu.net/ajax.php",
- get={'a': "getUserLogin"},
- post={'_go' : "",
- 'login' : user,
- 'pass' : data['password'],
- 'remember': "1"}))
+ json = json_loads(self.load("https://rapidu.net/ajax.php",
+ get={'a': "getUserLogin"},
+ post={'_go' : "",
+ 'login' : user,
+ 'pass' : password,
+ 'remember': "1"}))
- self.logDebug(json)
+ self.log_debug(json)
if not json['message'] == "success":
- self.wrongPassword()
+ self.login_fail()