diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-16 18:31:59 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-16 18:31:59 +0100 |
commit | 995b6ace8598f22fe8b21b67c587797baa6f7f21 (patch) | |
tree | 8d76eb1c9c6bca88d3c2ad7e6101d1a130ba5299 /module | |
parent | little fixes (diff) | |
download | pyload-995b6ace8598f22fe8b21b67c587797baa6f7f21.tar.xz |
correct utf8 conversion for urls
Diffstat (limited to 'module')
-rw-r--r-- | module/network/HTTPRequest.py | 6 | ||||
-rw-r--r-- | module/plugins/Base.py | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py index a0b419763..2f084efb5 100644 --- a/module/network/HTTPRequest.py +++ b/module/network/HTTPRequest.py @@ -28,12 +28,12 @@ from cStringIO import StringIO from module.plugins.Hoster import Abort def myquote(url): - return quote(url.encode('utf_8') if isinstance(url, unicode) else url, safe="%/:=&?~#+!$,;'@()*[]") + return quote(url.encode('utf8') if isinstance(url, unicode) else url, safe="%/:=&?~#+!$,;'@()*[]") def myurlencode(data): data = dict(data) - return urlencode(dict((x.encode('utf_8') if isinstance(x, unicode) else x, \ - y.encode('utf_8') if isinstance(y, unicode) else y ) for x, y in data.iteritems())) + return urlencode(dict((x.encode('utf8') if isinstance(x, unicode) else x, \ + y.encode('utf8') if isinstance(y, unicode) else y ) for x, y in data.iteritems())) bad_headers = range(400, 404) + range(405, 418) + range(500, 506) diff --git a/module/plugins/Base.py b/module/plugins/Base.py index 53840ee18..48a3707b1 100644 --- a/module/plugins/Base.py +++ b/module/plugins/Base.py @@ -167,8 +167,6 @@ class Base(object): """ if not hasattr(self, "req"): raise Exception("Plugin type does not have Request attribute.") - if type(url) == unicode: url = str(url) - res = self.req.load(url, get, post, ref, cookies, just_header, decode=decode) if self.core.debug: |