summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/XFSCrypter.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-02 16:45:49 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-02 16:45:49 +0200
commite6f7ba06c3d7ab9708f4960cbf359684155f9a5f (patch)
tree42799025e3d7b65e20295ac8a87b114924846601 /module/plugins/internal/XFSCrypter.py
parent[ClickAndLoad] Queue destination support (2) (diff)
downloadpyload-e6f7ba06c3d7ab9708f4960cbf359684155f9a5f.tar.xz
Fix https://github.com/pyload/pyload/issues/1911#issuecomment-145026557
Diffstat (limited to 'module/plugins/internal/XFSCrypter.py')
-rw-r--r--module/plugins/internal/XFSCrypter.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/module/plugins/internal/XFSCrypter.py b/module/plugins/internal/XFSCrypter.py
index 876575874..dd2fba568 100644
--- a/module/plugins/internal/XFSCrypter.py
+++ b/module/plugins/internal/XFSCrypter.py
@@ -7,7 +7,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
class XFSCrypter(SimpleCrypter):
__name__ = "XFSCrypter"
__type__ = "crypter"
- __version__ = "0.16"
+ __version__ = "0.17"
__status__ = "testing"
__pattern__ = r'^unmatchable$'
@@ -32,13 +32,16 @@ class XFSCrypter(SimpleCrypter):
def set_xfs_cookie(self):
- if not self.COOKIES:
+ if not self.PLUGIN_DOMAIN:
+ self.log_error(_("Unable to set xfs cookie due missing PLUGIN_DOMAIN"))
return
- if isinstance(self.COOKIES, list) and (self.PLUGIN_DOMAIN, "lang", "english") not in self.COOKIES:
- self.COOKIES.insert((self.PLUGIN_DOMAIN, "lang", "english"))
+ 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, self.PLUGIN_DOMAIN, "lang", "english")
+ set_cookie(self.req.cj, *cookie)
def prepare(self):
@@ -54,6 +57,7 @@ class XFSCrypter(SimpleCrypter):
else:
self.fail(_("Missing PLUGIN_DOMAIN"))
- self.set_xfs_cookie()
+ if self.COOKIES:
+ self.set_xfs_cookie()
return super(XFSCrypter, self).prepare()