From a5c25955128c2e7d77182001bc5c6b0391811e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Sat, 3 Sep 2016 00:10:12 +0200 Subject: Fix UnicodeDecodeError in multiple stages Based on patch: https://github.com/pyload/pyload/pull/2346/commits/71021a0f81232d1b78f9b61ac288922b0762c732 Contains one more fixed line. --- module/network/HTTPChunk.py | 2 +- 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'(?