From 58656b11f90cfc6bb8fc9a60df8482ef6b3c70df Mon Sep 17 00:00:00 2001 From: Nitzo Date: Sat, 27 Feb 2016 04:45:09 +0200 Subject: [Plugin] Load(): allow referer as string parameter --- module/plugins/internal/Plugin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/Plugin.py') 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 -- cgit v1.2.3