diff --git a/src/you_get/common.py b/src/you_get/common.py index 36be1999..fd0700a5 100755 --- a/src/you_get/common.py +++ b/src/you_get/common.py @@ -210,7 +210,8 @@ def get_content(url, headers={}, decoded=True): # Decode the response body 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: data = data.decode(charset) else: