summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/network/HTTPChunk.py2
-rw-r--r--module/plugins/internal/misc.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py
index b637aef32..a27084355 100644
--- a/module/network/HTTPChunk.py
+++ b/module/network/HTTPChunk.py
@@ -32,7 +32,7 @@ class WrongFormat(Exception):
class ChunkInfo():
def __init__(self, name):
- self.name = unicode(name)
+ self.name = unicode(name, 'utf-8')
self.size = 0
self.resume = False
self.chunks = []
diff --git a/module/plugins/internal/misc.py b/module/plugins/internal/misc.py
index fb8071b49..db63d5ffc 100644
--- a/module/plugins/internal/misc.py
+++ b/module/plugins/internal/misc.py
@@ -468,8 +468,9 @@ def fixurl(url, unquote=None):
if unquote is None:
unquote = url is old
- url = html_unescape(decode(url).decode('unicode-escape'))
+ url = html_unescape(decode(url))
url = re.sub(r'(?<!:)/{2,}', '/', url).strip().lstrip('.')
+ url = encode(url)
if not unquote:
url = urllib.quote(url)
@@ -538,6 +539,7 @@ def parse_name(value, safechar=True):
url_p.netloc.split('.', 1)[0])
name = urllib.unquote(name)
+ name = decode(name)
return safename(name) if safechar else name