summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/XFSAccount.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/internal/XFSAccount.py')
-rw-r--r--module/plugins/internal/XFSAccount.py38
1 files changed, 17 insertions, 21 deletions
diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py
index 1b424c964..66052df09 100644
--- a/module/plugins/internal/XFSAccount.py
+++ b/module/plugins/internal/XFSAccount.py
@@ -11,8 +11,8 @@ from module.plugins.internal.utils import parse_html_form, parse_time, set_cooki
class XFSAccount(MultiAccount):
__name__ = "XFSAccount"
__type__ = "account"
- __version__ = "0.54"
- __status__ = "testing"
+ __version__ = "0.55"
+ __status__ = "stable"
__config__ = [("activated" , "bool" , "Activated" , True ),
("multi" , "bool" , "Multi-hoster" , True ),
@@ -47,19 +47,28 @@ class XFSAccount(MultiAccount):
LOGIN_SKIP_PATTERN = r'op=logout'
- def set_xfs_cookie(self):
- if not self.PLUGIN_DOMAIN:
- self.log_warning(_("Unable to set xfs cookie due missing PLUGIN_DOMAIN"))
- return
-
+ def _set_xfs_cookie(self):
cookie = (self.PLUGIN_DOMAIN, "lang", "english")
-
if isinstance(self.COOKIES, list) and cookie not in self.COOKIES:
self.COOKIES.insert(cookie)
else:
set_cookie(self.req.cj, *cookie)
+ def setup(self):
+ if not self.PLUGIN_DOMAIN:
+ self.fail_login(_("Missing PLUGIN_DOMAIN"))
+
+ if not self.PLUGIN_URL:
+ self.PLUGIN_URL = "http://www.%s/" % self.PLUGIN_DOMAIN
+
+ if not self.LOGIN_URL:
+ self.LOGIN_URL = urlparse.urljoin(self.PLUGIN_URL, "login.html")
+
+ if self.COOKIES:
+ self._set_xfs_cookie()
+
+
def grab_hosters(self, user, password, data):
pass
@@ -164,19 +173,6 @@ class XFSAccount(MultiAccount):
def signin(self, user, password, data):
- if self.PLUGIN_DOMAIN:
- if not self.PLUGIN_URL:
- self.PLUGIN_URL = "http://www.%s/" % self.PLUGIN_DOMAIN
-
- if self.COOKIES:
- self.set_xfs_cookie()
-
- if not self.PLUGIN_URL:
- self.fail_login(_("Missing PLUGIN_URL"))
-
- if not self.LOGIN_URL:
- self.LOGIN_URL = urlparse.urljoin(self.PLUGIN_URL, "login.html")
-
self.html = self.load(self.LOGIN_URL, cookies=self.COOKIES)
if re.search(self.LOGIN_SKIP_PATTERN, self.html):