diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-02 00:26:01 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-02 00:26:01 +0200 |
commit | 4e6234d8530c513ae37307f57d65c8c2b56efb1f (patch) | |
tree | 9c72621104bb7e04ebd4c90bb804bfd2b546636f /module/plugins | |
parent | Fixpack (1) (diff) | |
download | pyload-4e6234d8530c513ae37307f57d65c8c2b56efb1f.tar.xz |
[Plugin] Improve fixurl function
https://github.com/pyload/pyload/issues/1873
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/internal/Plugin.py | 10 |
1 files changed, 7 insertions, 3 deletions
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$' |