mirror of
https://github.com/soimort/you-get.git
synced 2025-02-11 20:52:31 +03:00
Merge branch 'fix'
This commit is contained in:
commit
54c6033595
@ -210,7 +210,8 @@ def get_content(url, headers={}, decoded=True):
|
|||||||
|
|
||||||
# Decode the response body
|
# Decode the response body
|
||||||
if decoded:
|
if decoded:
|
||||||
charset = match1(response.getheader('Content-Type'), r'charset=([\w-]+)')
|
charset = match1(response.getheader('Content-Type'), r'charset=([\w-]+)') or \
|
||||||
|
match1(str(data), r'charset=([\w-]+)')
|
||||||
if charset is not None:
|
if charset is not None:
|
||||||
data = data.decode(charset)
|
data = data.decode(charset)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user