diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2016-09-03 00:10:12 +0200 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2016-09-03 00:10:12 +0200 |
commit | a5c25955128c2e7d77182001bc5c6b0391811e48 (patch) | |
tree | 16d8a57a1f6f57a91a6a4cecff909242ee8b3c1f | |
parent | Merge pull request #2582 from valdi74/patch-2 (diff) | |
download | pyload-a5c25955128c2e7d77182001bc5c6b0391811e48.tar.xz |
Fix UnicodeDecodeError in multiple stagesfixed
Based on patch:
https://github.com/pyload/pyload/pull/2346/commits/71021a0f81232d1b78f9b61ac288922b0762c732
Contains one more fixed line.
-rw-r--r-- | module/network/HTTPChunk.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/misc.py | 4 |
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 |