summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/XFSAccount.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-01 18:59:55 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-01 18:59:55 +0200
commit8d85a655d8cc408574f471306613bc05115c8c64 (patch)
treea468f6fdc525497d94e2bc43e263ac68e676cf4e /module/plugins/internal/XFSAccount.py
parentA lot of plugin code cosmetics (2) (diff)
downloadpyload-8d85a655d8cc408574f471306613bc05115c8c64.tar.xz
Improve Hoster and Crypter + general fixup
Diffstat (limited to 'module/plugins/internal/XFSAccount.py')
-rw-r--r--module/plugins/internal/XFSAccount.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py
index 3b92a191b..7b9410222 100644
--- a/module/plugins/internal/XFSAccount.py
+++ b/module/plugins/internal/XFSAccount.py
@@ -13,7 +13,7 @@ from module.plugins.internal.Plugin import parse_html_form, set_cookie
class XFSAccount(Account):
__name__ = "XFSAccount"
__type__ = "account"
- __version__ = "0.48"
+ __version__ = "0.49"
__status__ = "testing"
__description__ = """XFileSharing account plugin"""
@@ -42,6 +42,16 @@ class XFSAccount(Account):
LOGIN_SKIP_PATTERN = r'op=logout'
+ def set_xfs_cookie(self):
+ if not self.COOKIES:
+ return
+
+ if isinstance(self.COOKIES, list) and (self.PLUGIN_DOMAIN, "lang", "english") not in self.COOKIES:
+ self.COOKIES.insert((self.PLUGIN_DOMAIN, "lang", "english"))
+ else:
+ set_cookie(self.req.cj, self.PLUGIN_DOMAIN, "lang", "english")
+
+
def grab_info(self, user, password, data):
validuntil = None
trafficleft = None
@@ -146,11 +156,7 @@ class XFSAccount(Account):
if not self.PLUGIN_URL:
self.PLUGIN_URL = "http://www.%s/" % self.PLUGIN_DOMAIN
- if self.COOKIES:
- if isinstance(self.COOKIES, list) and (self.PLUGIN_DOMAIN, "lang", "english") not in self.COOKIES:
- self.COOKIES.insert((self.PLUGIN_DOMAIN, "lang", "english"))
- else:
- set_cookie(self.req.cj, self.PLUGIN_DOMAIN, "lang", "english")
+ self.set_xfs_cookie()
if not self.PLUGIN_URL:
self.fail_login(_("Missing PLUGIN_URL"))