summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/UploadingCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/UploadingCom.py')
-rw-r--r--module/plugins/accounts/UploadingCom.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/module/plugins/accounts/UploadingCom.py b/module/plugins/accounts/UploadingCom.py
index a20c44535..d269abde7 100644
--- a/module/plugins/accounts/UploadingCom.py
+++ b/module/plugins/accounts/UploadingCom.py
@@ -3,14 +3,15 @@
import re
import time
-from module.plugins.Account import Account
-from module.plugins.internal.SimpleHoster import set_cookies
+from module.plugins.internal.Account import Account
+from module.plugins.internal.Plugin import set_cookies
class UploadingCom(Account):
__name__ = "UploadingCom"
__type__ = "account"
- __version__ = "0.12"
+ __version__ = "0.14"
+ __status__ = "testing"
__description__ = """Uploading.com account plugin"""
__license__ = "GPLv3"
@@ -21,25 +22,25 @@ class UploadingCom(Account):
VALID_UNTIL_PATTERN = r'Valid Until:(.+?)<'
- def loadAccountInfo(self, user, req):
+ def parse_info(self, user, password, data, req):
validuntil = None
trafficleft = None
premium = None
- html = req.load("http://uploading.com/")
+ html = self.load("http://uploading.com/")
premium = False if re.search(self.PREMIUM_PATTERN, html) else True
m = re.search(self.VALID_UNTIL_PATTERN, html)
if m:
expiredate = m.group(1).strip()
- self.logDebug("Expire date: " + expiredate)
+ self.log_debug("Expire date: " + expiredate)
try:
validuntil = time.mktime(time.strptime(expiredate, "%b %d, %Y"))
except Exception, e:
- self.logError(e)
+ self.log_error(e)
else:
if validuntil > time.mktime(time.gmtime()):
@@ -53,13 +54,15 @@ class UploadingCom(Account):
'premium' : premium}
- def login(self, user, data, req):
+ def login(self, user, password, data, req):
set_cookies(req.cj,
[("uploading.com", "lang" , "1" ),
("uploading.com", "language", "1" ),
("uploading.com", "setlang" , "en"),
("uploading.com", "_lang" , "en")])
- req.load("http://uploading.com/")
- req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time.time() * 1000),
- post={'email': user, 'password': data['password'], 'remember': "on"})
+ self.load("http://uploading.com/")
+ self.load("https://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time.time() * 1000),
+ post={'email' : user,
+ 'password': password,
+ 'remember': "on"})