diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-02 16:45:49 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-02 16:45:49 +0200 |
commit | e6f7ba06c3d7ab9708f4960cbf359684155f9a5f (patch) | |
tree | 42799025e3d7b65e20295ac8a87b114924846601 /module/plugins/internal/XFSHoster.py | |
parent | [ClickAndLoad] Queue destination support (2) (diff) | |
download | pyload-e6f7ba06c3d7ab9708f4960cbf359684155f9a5f.tar.xz |
Fix https://github.com/pyload/pyload/issues/1911#issuecomment-145026557
Diffstat (limited to 'module/plugins/internal/XFSHoster.py')
-rw-r--r-- | module/plugins/internal/XFSHoster.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index b59f34122..99a091129 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -14,7 +14,7 @@ from module.utils import html_unescape class XFSHoster(SimpleHoster): __name__ = "XFSHoster" __type__ = "hoster" - __version__ = "0.63" + __version__ = "0.64" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -61,13 +61,16 @@ class XFSHoster(SimpleHoster): 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): @@ -85,7 +88,8 @@ class XFSHoster(SimpleHoster): else: self.fail(_("Missing PLUGIN_DOMAIN")) - self.set_xfs_cookie() + if self.COOKIES: + self.set_xfs_cookie() if not self.LINK_PATTERN: pattern = r'(?:file: "(.+?)"|(https?://(?:www\.)?([^/]*?%s|\d+\.\d+\.\d+\.\d+)(\:\d+)?(/d/|(/files)?/\d+/\w+/).+?)["\'<])' |