si pas d'encodage, on ne force rien
This commit is contained in:
parent
1f12e8b3fb
commit
41196cd32d
@ -53,8 +53,13 @@ class SimpleDownloader(Downloader):
|
||||
resource = urllib.request.urlopen(req, post_args)
|
||||
else:
|
||||
resource = urllib.request.urlopen(req)
|
||||
data = resource.read().decode(resource.headers.get_content_charset())
|
||||
charset = resource.headers.get_content_charset()
|
||||
if charset:
|
||||
data = resource.read().decode(charset)
|
||||
else:
|
||||
data = resource.read().decode()
|
||||
return data
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return None
|
||||
|
Loading…
Reference in New Issue
Block a user