diff options
author | Nitzo <nitzo2001@yahoo.com> | 2016-02-27 03:45:09 +0100 |
---|---|---|
committer | Nitzo <nitzo2001@yahoo.com> | 2016-02-27 03:45:09 +0100 |
commit | 58656b11f90cfc6bb8fc9a60df8482ef6b3c70df (patch) | |
tree | 844f2522fe47a4ec9a6249e09a5c1a8289b13949 /module | |
parent | [AntiStandby] Unactivated by default (diff) | |
download | pyload-58656b11f90cfc6bb8fc9a60df8482ef6b3c70df.tar.xz |
[Plugin] Load(): allow referer as string parameter
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/internal/Plugin.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index f8e54ff37..1147cf890 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -17,11 +17,13 @@ from module.plugins.Plugin import Abort, Fail, Reconnect, Retry, SkipDownload as from module.plugins.internal.misc import (Config, DB, decode, encode, exists, fixurl, fsjoin, format_exc, html_unescape, parse_html_header, remove, set_cookies) +_decode = decode #@NOTE: save decode() as _decode() for use with load(url, decode='decode-str') + class Plugin(object): __name__ = "Plugin" __type__ = "plugin" - __version__ = "0.66" + __version__ = "0.67" __status__ = "stable" __config__ = [] #: [("name", "type", "desc", "default")] @@ -197,7 +199,11 @@ class Plugin(object): elif type(redirect) is int: req.http.c.setopt(pycurl.MAXREDIRS, redirect) - html = req.load(url, get, post, ref, bool(cookies), just_header, multipart, decode is True) #@TODO: Fix network multipart in 0.4.10 + #@TODO: Move to network in 0.4.10 + if isinstance(ref, basestring): + req.lastURL = ref + + html = req.load(url, get, post, bool(ref), bool(cookies), just_header, multipart, decode is True) #@TODO: Fix network multipart in 0.4.10 #@TODO: Move to network in 0.4.10 if not redirect: @@ -213,7 +219,7 @@ class Plugin(object): #@TODO: Move to network in 0.4.10 if isinstance(decode, basestring): - html = decode(html, decode) + html = _decode(html, decode) self.last_html = html |