From e76ecbb11c1f0cc104e0631d6a9dd0b6f358bd0c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 11 Oct 2015 02:55:22 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1960 --- module/plugins/accounts/UptoboxCom.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts') 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() -- cgit v1.2.3