From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/internal/XFSAccount.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index e619cb038..f230cedf3 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -4,14 +4,14 @@ import re import time import urlparse -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies class XFSAccount(Account): __name__ = "XFSAccount" __type__ = "account" - __version__ = "0.37" + __version__ = "0.38" __description__ = """XFileSharing account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/internal/XFSAccount.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index f230cedf3..c26a91775 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -5,7 +5,7 @@ import time import urlparse from module.plugins.internal.Account import Account -from module.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies +from module.plugins.internal.Plugin import parseHtmlForm, set_cookies class XFSAccount(Account): @@ -38,11 +38,6 @@ class XFSAccount(Account): LOGIN_FAIL_PATTERN = r'Incorrect Login or Password|account was banned|Error<' - def __init__(self, manager, accounts): #@TODO: remove in 0.4.10 - self.init() - return super(XFSAccount, self).__init__(manager, accounts) - - def init(self): if not self.HOSTER_DOMAIN: self.logError(_("Missing HOSTER_DOMAIN")) @@ -69,7 +64,7 @@ class XFSAccount(Account): 'leechtraffic': leechtraffic, 'premium' : premium} - html = req.load(self.HOSTER_URL, get={'op': "my_account"}, decode=True) + html = self.load(self.HOSTER_URL, get={'op': "my_account"}, req=req) premium = True if re.search(self.PREMIUM_PATTERN, html) else False @@ -160,7 +155,7 @@ class XFSAccount(Account): if not self.LOGIN_URL: self.LOGIN_URL = urlparse.urljoin(self.HOSTER_URL, "login.html") - html = req.load(self.LOGIN_URL, decode=True) + html = self.load(self.LOGIN_URL, req=req) action, inputs = parseHtmlForm('name="FL"', html) if not inputs: @@ -175,7 +170,7 @@ class XFSAccount(Account): else: url = self.HOSTER_URL - html = req.load(url, post=inputs, decode=True) + html = self.load(url, post=inputs, req=req) if re.search(self.LOGIN_FAIL_PATTERN, html): self.wrongPassword() -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/internal/XFSAccount.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index c26a91775..fb2302f4c 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -11,7 +11,7 @@ from module.plugins.internal.Plugin import parseHtmlForm, set_cookies class XFSAccount(Account): __name__ = "XFSAccount" __type__ = "account" - __version__ = "0.38" + __version__ = "0.39" __description__ = """XFileSharing account plugin""" __license__ = "GPLv3" @@ -40,7 +40,7 @@ class XFSAccount(Account): def init(self): if not self.HOSTER_DOMAIN: - self.logError(_("Missing HOSTER_DOMAIN")) + self.log_error(_("Missing HOSTER_DOMAIN")) self.COOKIES = False else: @@ -52,7 +52,7 @@ class XFSAccount(Account): set_cookies(req.cj, self.COOKIES) - def loadAccountInfo(self, user, req): + def load_account_info(self, user, req): validuntil = None trafficleft = None leechtraffic = None @@ -71,16 +71,16 @@ class XFSAccount(Account): 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, "%d %B %Y")) except Exception, e: - self.logError(e) + self.log_error(e) else: - self.logDebug("Valid until: %s" % validuntil) + self.log_debug("Valid until: %s" % validuntil) if validuntil > time.mktime(time.gmtime()): premium = True @@ -89,7 +89,7 @@ class XFSAccount(Account): premium = False validuntil = None #: registered account type (not premium) else: - self.logDebug("VALID_UNTIL_PATTERN not found") + self.log_debug("VALID_UNTIL_PATTERN not found") m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: @@ -109,12 +109,12 @@ class XFSAccount(Account): else: unit = "" - trafficleft = self.parseTraffic(size + unit) + trafficleft = self.parse_traffic(size + unit) except Exception, e: - self.logError(e) + self.log_error(e) else: - self.logDebug("TRAFFIC_LEFT_PATTERN not found") + self.log_debug("TRAFFIC_LEFT_PATTERN not found") leech = [m.groupdict() for m in re.finditer(self.LEECH_TRAFFIC_PATTERN, html)] if leech: @@ -136,12 +136,12 @@ class XFSAccount(Account): else: unit = "" - leechtraffic += self.parseTraffic(size + unit) + leechtraffic += self.parse_traffic(size + unit) except Exception, e: - self.logError(e) + self.log_error(e) else: - self.logDebug("LEECH_TRAFFIC_PATTERN not found") + self.log_debug("LEECH_TRAFFIC_PATTERN not found") return {'validuntil' : validuntil, 'trafficleft' : trafficleft, @@ -173,4 +173,4 @@ class XFSAccount(Account): html = self.load(url, post=inputs, req=req) if re.search(self.LOGIN_FAIL_PATTERN, html): - self.wrongPassword() + self.wrong_password() -- cgit v1.2.3 From d2e2b127651a5a44b56337eb6d9ca246c97a208a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 03:03:26 +0200 Subject: Spare fixes and code cosmetics --- module/plugins/internal/XFSAccount.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index fb2302f4c..23759f6d3 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -5,7 +5,7 @@ import time import urlparse from module.plugins.internal.Account import Account -from module.plugins.internal.Plugin import parseHtmlForm, set_cookies +from module.plugins.internal.Plugin import parse_html_form, set_cookies class XFSAccount(Account): @@ -157,7 +157,7 @@ class XFSAccount(Account): self.LOGIN_URL = urlparse.urljoin(self.HOSTER_URL, "login.html") html = self.load(self.LOGIN_URL, req=req) - action, inputs = parseHtmlForm('name="FL"', html) + action, inputs = parse_html_form('name="FL"', html) if not inputs: inputs = {'op' : "login", 'redirect': self.HOSTER_URL} -- cgit v1.2.3 From 1f5a55ae2133a782bdcca334ecbcdbde50dbcf99 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 15:29:48 +0200 Subject: No more need to use the req argument when call load method --- module/plugins/internal/XFSAccount.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 23759f6d3..4005b8e21 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -64,7 +64,7 @@ class XFSAccount(Account): 'leechtraffic': leechtraffic, 'premium' : premium} - html = self.load(self.HOSTER_URL, get={'op': "my_account"}, req=req) + html = self.load(self.HOSTER_URL, get={'op': "my_account"}) premium = True if re.search(self.PREMIUM_PATTERN, html) else False @@ -155,7 +155,7 @@ class XFSAccount(Account): if not self.LOGIN_URL: self.LOGIN_URL = urlparse.urljoin(self.HOSTER_URL, "login.html") - html = self.load(self.LOGIN_URL, req=req) + html = self.load(self.LOGIN_URL) action, inputs = parse_html_form('name="FL"', html) if not inputs: @@ -170,7 +170,7 @@ class XFSAccount(Account): else: url = self.HOSTER_URL - html = self.load(url, post=inputs, req=req) + html = self.load(url, post=inputs) if re.search(self.LOGIN_FAIL_PATTERN, html): self.wrong_password() -- cgit v1.2.3 From dad722ac7255640e7e0541c4094a4d2e4de79cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 00:05:58 +0200 Subject: Code cosmetics (2) --- module/plugins/internal/XFSAccount.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 4005b8e21..7ae6d816e 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -30,10 +30,10 @@ class XFSAccount(Account): VALID_UNTIL_PATTERN = r'Premium.[Aa]ccount expire:.*?(\d{1,2} [\w^_]+ \d{4})' TRAFFIC_LEFT_PATTERN = r'Traffic available today:.*?\s*(?P[\d.,]+|[Uu]nlimited)\s*(?:(?P[\w^_]+)\s*)?' - TRAFFIC_LEFT_UNIT = "MB" #: used only if no group was found + TRAFFIC_LEFT_UNIT = "MB" #: Used only if no group was found LEECH_TRAFFIC_PATTERN = r'Leech Traffic left:.*?(?P[\d.,]+|[Uu]nlimited)\s*(?:(?P[\w^_]+)\s*)?' - LEECH_TRAFFIC_UNIT = "MB" #: used only if no group was found + LEECH_TRAFFIC_UNIT = "MB" #: Used only if no group was found LOGIN_FAIL_PATTERN = r'Incorrect Login or Password|account was banned|Error<' @@ -87,7 +87,7 @@ class XFSAccount(Account): trafficleft = -1 else: premium = False - validuntil = None #: registered account type (not premium) + validuntil = None #: Registered account type (not premium) else: self.log_debug("VALID_UNTIL_PATTERN not found") -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/internal/XFSAccount.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 7ae6d816e..b5028eda6 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -12,6 +12,7 @@ class XFSAccount(Account): __name__ = "XFSAccount" __type__ = "account" __version__ = "0.39" + __status__ = "stable" __description__ = """XFileSharing account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/internal/XFSAccount.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index b5028eda6..8612bad63 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -12,7 +12,7 @@ class XFSAccount(Account): __name__ = "XFSAccount" __type__ = "account" __version__ = "0.39" - __status__ = "stable" + __status__ = "testing" __description__ = """XFileSharing account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 8f17f875f6e28f73ddb10da59c6464bd04922222 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 04:59:27 +0200 Subject: Account rewritten --- module/plugins/internal/XFSAccount.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 8612bad63..7df169ee9 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -53,7 +53,7 @@ class XFSAccount(Account): set_cookies(req.cj, self.COOKIES) - def load_account_info(self, user, req): + def parse_info(self, user, req): validuntil = None trafficleft = None leechtraffic = None @@ -150,7 +150,7 @@ class XFSAccount(Account): 'premium' : premium} - def login(self, user, data, req): + def login(self, user, password, info, req): if not self.HOSTER_URL: #@TODO: Remove in 0.4.10 raise Exception(_("Missing HOSTER_DOMAIN")) @@ -174,4 +174,4 @@ class XFSAccount(Account): html = self.load(url, post=inputs) if re.search(self.LOGIN_FAIL_PATTERN, html): - self.wrong_password() + self.fail() -- cgit v1.2.3 From 34f48259060656077b5cb45edd8f9d92bb0282de Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Jul 2015 20:19:03 +0200 Subject: Bunch of fixups --- module/plugins/internal/XFSAccount.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 7df169ee9..6d6cc97e7 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -53,7 +53,7 @@ class XFSAccount(Account): set_cookies(req.cj, self.COOKIES) - def parse_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = None leechtraffic = None @@ -150,7 +150,7 @@ class XFSAccount(Account): 'premium' : premium} - def login(self, user, password, info, req): + def login(self, user, password, data, req): if not self.HOSTER_URL: #@TODO: Remove in 0.4.10 raise Exception(_("Missing HOSTER_DOMAIN")) @@ -164,7 +164,7 @@ class XFSAccount(Account): 'redirect': self.HOSTER_URL} inputs.update({'login' : user, - 'password': data['password']}) + 'password': password}) if action: url = urlparse.urljoin("http://", action) @@ -174,4 +174,4 @@ class XFSAccount(Account): html = self.load(url, post=inputs) if re.search(self.LOGIN_FAIL_PATTERN, html): - self.fail() + self.login_fail() -- cgit v1.2.3 From 95ed76d34290e08876dccce6840c3e09138a2047 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Jul 2015 23:47:47 +0200 Subject: Spare code fixes --- module/plugins/internal/XFSAccount.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 6d6cc97e7..93a04dc86 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -151,8 +151,8 @@ class XFSAccount(Account): def login(self, user, password, data, req): - if not self.HOSTER_URL: #@TODO: Remove in 0.4.10 - raise Exception(_("Missing HOSTER_DOMAIN")) + if not self.HOSTER_URL: + self.login_fail(_("Missing HOSTER_DOMAIN")) if not self.LOGIN_URL: self.LOGIN_URL = urlparse.urljoin(self.HOSTER_URL, "login.html") -- cgit v1.2.3 From 6f387ff66b93e24cc52db7a5ea277265d35f051d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Jul 2015 00:29:19 +0200 Subject: Missed to bump up some plugin __version__ --- module/plugins/internal/XFSAccount.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 93a04dc86..5bf959400 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -11,7 +11,7 @@ from module.plugins.internal.Plugin import parse_html_form, set_cookies class XFSAccount(Account): __name__ = "XFSAccount" __type__ = "account" - __version__ = "0.39" + __version__ = "0.40" __status__ = "testing" __description__ = """XFileSharing account plugin""" -- cgit v1.2.3 From d0acce3be51760fc97c6d8cf298ef37ba2f299ec Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 18:37:00 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1591 --- module/plugins/internal/XFSAccount.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 5bf959400..0cd723bab 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -152,7 +152,7 @@ class XFSAccount(Account): def login(self, user, password, data, req): if not self.HOSTER_URL: - self.login_fail(_("Missing HOSTER_DOMAIN")) + self.login_fail(_("Missing HOSTER_URL")) if not self.LOGIN_URL: self.LOGIN_URL = urlparse.urljoin(self.HOSTER_URL, "login.html") -- cgit v1.2.3 From e5ce0acf056dc96c40d5616ab6d2b82f998eefbe Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 3 Aug 2015 00:37:57 +0200 Subject: Use set_cookie instead cj.setCookie --- module/plugins/internal/XFSAccount.py | 36 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 0cd723bab..efb84de35 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -5,13 +5,13 @@ import time import urlparse from module.plugins.internal.Account import Account -from module.plugins.internal.Plugin import parse_html_form, set_cookies +from module.plugins.internal.Plugin import parse_html_form, set_cookie class XFSAccount(Account): __name__ = "XFSAccount" __type__ = "account" - __version__ = "0.40" + __version__ = "0.41" __status__ = "testing" __description__ = """XFileSharing account plugin""" @@ -39,20 +39,6 @@ class XFSAccount(Account): LOGIN_FAIL_PATTERN = r'Incorrect Login or Password|account was banned|Error<' - def init(self): - if not self.HOSTER_DOMAIN: - self.log_error(_("Missing HOSTER_DOMAIN")) - self.COOKIES = False - - else: - if not self.HOSTER_URL: - self.HOSTER_URL = "http://www.%s/" % self.HOSTER_DOMAIN - - if isinstance(self.COOKIES, list): - self.COOKIES.insert((self.HOSTER_DOMAIN, "lang", "english")) - set_cookies(req.cj, self.COOKIES) - - def parse_info(self, user, password, data, req): validuntil = None trafficleft = None @@ -65,7 +51,9 @@ class XFSAccount(Account): 'leechtraffic': leechtraffic, 'premium' : premium} - html = self.load(self.HOSTER_URL, get={'op': "my_account"}) + html = self.load(self.HOSTER_URL, + get={'op': "my_account"}, + cookies=self.COOKIES) premium = True if re.search(self.PREMIUM_PATTERN, html) else False @@ -151,12 +139,22 @@ class XFSAccount(Account): def login(self, user, password, data, req): + if self.HOSTER_DOMAIN: + if not self.HOSTER_URL: + self.HOSTER_URL = "http://www.%s/" % self.HOSTER_DOMAIN + + if isinstance(self.COOKIES, list): + self.COOKIES.insert((self.HOSTER_DOMAIN, "lang", "english")) + else: + set_cookie(req.cj, self.HOSTER_DOMAIN, "lang", "english") + if not self.HOSTER_URL: self.login_fail(_("Missing HOSTER_URL")) if not self.LOGIN_URL: self.LOGIN_URL = urlparse.urljoin(self.HOSTER_URL, "login.html") - html = self.load(self.LOGIN_URL) + + html = self.load(self.LOGIN_URL, cookies=self.COOKIES) action, inputs = parse_html_form('name="FL"', html) if not inputs: @@ -171,7 +169,7 @@ class XFSAccount(Account): else: url = self.HOSTER_URL - html = self.load(url, post=inputs) + html = self.load(url, post=inputs, cookies=self.COOKIES) if re.search(self.LOGIN_FAIL_PATTERN, html): self.login_fail() -- cgit v1.2.3 From 05a9b379f63c16cf1b320d81ab49abf8ba167a84 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Mon, 3 Aug 2015 21:30:18 +0300 Subject: Update XFSAccount.py --- module/plugins/internal/XFSAccount.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index efb84de35..7093ccd27 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -143,10 +143,11 @@ class XFSAccount(Account): if not self.HOSTER_URL: self.HOSTER_URL = "http://www.%s/" % self.HOSTER_DOMAIN - if isinstance(self.COOKIES, list): - self.COOKIES.insert((self.HOSTER_DOMAIN, "lang", "english")) - else: - set_cookie(req.cj, self.HOSTER_DOMAIN, "lang", "english") + if hasattr(self, 'COOKIES'): + if isinstance(self.COOKIES, list): + self.COOKIES.insert((self.HOSTER_DOMAIN, "lang", "english")) + else: + set_cookie(req.cj, self.HOSTER_DOMAIN, "lang", "english") if not self.HOSTER_URL: self.login_fail(_("Missing HOSTER_URL")) -- cgit v1.2.3 From 2cf928db10224b5327f918dceaa13273753620ac Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 4 Aug 2015 18:06:42 +0200 Subject: Some fixes --- module/plugins/internal/XFSAccount.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/internal/XFSAccount.py') diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 7093ccd27..e0f6b1ee8 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -11,7 +11,7 @@ from module.plugins.internal.Plugin import parse_html_form, set_cookie class XFSAccount(Account): __name__ = "XFSAccount" __type__ = "account" - __version__ = "0.41" + __version__ = "0.42" __status__ = "testing" __description__ = """XFileSharing account plugin""" @@ -143,11 +143,11 @@ class XFSAccount(Account): if not self.HOSTER_URL: self.HOSTER_URL = "http://www.%s/" % self.HOSTER_DOMAIN - if hasattr(self, 'COOKIES'): - if isinstance(self.COOKIES, list): + if self.COOKIES: + if isinstance(self.COOKIES, list) and not self.COOKIES.count((self.HOSTER_DOMAIN, "lang", "english")): self.COOKIES.insert((self.HOSTER_DOMAIN, "lang", "english")) else: - set_cookie(req.cj, self.HOSTER_DOMAIN, "lang", "english") + set_cookie(self.req.cj, self.HOSTER_DOMAIN, "lang", "english") if not self.HOSTER_URL: self.login_fail(_("Missing HOSTER_URL")) -- cgit v1.2.3