diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-11 02:55:22 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-11 02:55:22 +0200 |
commit | e76ecbb11c1f0cc104e0631d6a9dd0b6f358bd0c (patch) | |
tree | 6575b6fb40e049429f941ebb730f444f04e9ca2f /module/plugins/accounts | |
parent | Fix https://github.com/pyload/pyload/issues/1998 (diff) | |
download | pyload-e76ecbb11c1f0cc104e0631d6a9dd0b6f358bd0c.tar.xz |
Fix https://github.com/pyload/pyload/issues/1960
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/UptoboxCom.py | 30 |
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() |