diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-07-05 13:14:40 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-07-05 13:14:40 +0200 |
commit | fe70307e0b6916cc5a4273c73cdd355dee02546a (patch) | |
tree | 9bd0ea05d8d31ac4a1705ea2405c27ecbe42d772 | |
parent | Fix long int conversion issue (diff) | |
download | pyload-fe70307e0b6916cc5a4273c73cdd355dee02546a.tar.xz |
[Plugin] Fix decoding in load method
-rw-r--r-- | module/plugins/internal/Plugin.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index 1f86214c4..9b110280e 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -2,6 +2,7 @@ from __future__ import with_statement +import inspect import os import re import urllib @@ -260,14 +261,9 @@ class Plugin(object): res = req.load(url, get, post, ref, cookies, just_header, True, bool(decode)) if decode: - res = html_unescape(res) - - if isinstance(decode, basestring): - res = res.decode(decode) + res = html_unescape(res).decode(decode if isinstance(decode, basestring) else 'utf8') if self.core.debug: - import inspect - frame = inspect.currentframe() framefile = fs_join("tmp", self.__name__, "%s_line%s.dump.html" % (frame.f_back.f_code.co_name, frame.f_back.f_lineno)) try: |