summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/UptoboxCom.py30
1 files changed, 27 insertions, 3 deletions
diff --git a/module/plugins/accounts/UptoboxCom.py b/module/plugins/accounts/UptoboxCom.py
index 8df558e2a..277e0798b 100644
--- a/module/plugins/accounts/UptoboxCom.py
+++ b/module/plugins/accounts/UptoboxCom.py
@@ -1,12 +1,16 @@
# -*- coding: utf-8 -*-
+import re
+import urlparse
+
+from module.common.json_layer import json_loads
from module.plugins.internal.XFSAccount import XFSAccount
class UptoboxCom(XFSAccount):
__name__ = "UptoboxCom"
__type__ = "account"
- __version__ = "0.13"
+ __version__ = "0.15"
__status__ = "testing"
__description__ = """Uptobox.com account plugin"""
@@ -15,5 +19,25 @@ class UptoboxCom(XFSAccount):
PLUGIN_DOMAIN = "uptobox.com"
- PLUGIN_URL = "https://uptobox.com/"
- LOGIN_URL = "https://login.uptobox.com/logarithme/"
+ PLUGIN_URL = "http://uptobox.com/"
+ LOGIN_URL = "https://login.uptobox.com/"
+
+
+ def signin(self, user, password, data):
+ if self.COOKIES:
+ self.set_xfs_cookie()
+
+ html = self.load(self.LOGIN_URL, cookies=self.COOKIES)
+
+ if re.search(self.LOGIN_SKIP_PATTERN, html):
+ self.skip_login()
+
+ html = self.load(urlparse.urljoin(self.LOGIN_URL, "logarithme"),
+ post={'op' : "login",
+ 'redirect': self.PLUGIN_URL,
+ 'login' : user,
+ 'password': password},
+ cookies=self.COOKIES)
+
+ if json_loads(html).get('error'):
+ self.fail_login()