summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/plugins/internal/Base.py8
-rw-r--r--module/plugins/internal/Plugin.py13
2 files changed, 10 insertions, 11 deletions
diff --git a/module/plugins/internal/Base.py b/module/plugins/internal/Base.py
index 6f0a902f3..c57b58ef0 100644
--- a/module/plugins/internal/Base.py
+++ b/module/plugins/internal/Base.py
@@ -47,7 +47,7 @@ def check_abort(fn):
class Base(Plugin):
__name__ = "Base"
__type__ = "base"
- __version__ = "0.11"
+ __version__ = "0.12"
__status__ = "testing"
__pattern__ = r'^unmatchable$'
@@ -405,10 +405,8 @@ class Base(Plugin):
def fixurl(self, url, baseurl=None, unquote=True):
- #url = fixurl(url, unquote=False)
-
- if not baseurl:
- baseurl = fixurl(self.pyfile.url)
+ url = fixurl(url, unquote=True)
+ baseurl = fixurl(baseurl or self.pyfile.url, unquote=True)
if not urlparse.urlparse(url).scheme:
url_p = urlparse.urlparse(baseurl)
diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py
index c1b994d02..f5db49d8b 100644
--- a/module/plugins/internal/Plugin.py
+++ b/module/plugins/internal/Plugin.py
@@ -85,18 +85,19 @@ def exists(path):
def fixurl(url, unquote=None):
- newurl = urllib.unquote(url)
+ old = url
+ url = urllib.unquote(url)
if unquote is None:
- unquote = newurl == url
+ unquote = url is old
- newurl = html_unescape(decode(newurl).decode('unicode-escape'))
- newurl = re.sub(r'(?<!:)/{2,}', '/', newurl).strip().lstrip('.')
+ url = html_unescape(decode(url).decode('unicode-escape'))
+ url = re.sub(r'(?<!:)/{2,}', '/', url).strip().lstrip('.')
if not unquote:
- newurl = urllib.quote(newurl)
+ url = urllib.quote(url)
- return newurl
+ return url
def parse_name(string):