From 4e6234d8530c513ae37307f57d65c8c2b56efb1f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 2 Oct 2015 00:26:01 +0200 Subject: [Plugin] Improve fixurl function https://github.com/pyload/pyload/issues/1873 --- module/plugins/internal/Plugin.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index 5725bfa58..4546186d4 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -61,9 +61,13 @@ def fixurl(url, unquote=None): if unquote is None: unquote = newurl == url - newurl = html_unescape(newurl.decode('unicode-escape')).strip() + newurl = html_unescape(newurl.decode('unicode-escape')) + newurl = re.sub(r'/{2,}', '/', newurl).strip().lstrip('.') - return newurl if unquote else urllib.quote(newurl) + if not unquote: + newurl = urllib.quote(newurl) + + return newurl #@TODO: Recheck in 0.4.10 @@ -186,7 +190,7 @@ def chunks(iterable, size): class Plugin(object): __name__ = "Plugin" __type__ = "plugin" - __version__ = "0.41" + __version__ = "0.42" __status__ = "testing" __pattern__ = r'^unmatchable$' -- cgit v1.2.3