diff options
| author | 2019-11-26 13:58:37 +0000 | |
|---|---|---|
| committer | 2019-11-26 13:58:37 +0000 | |
| commit | 8e9da0d68148a64917c681606961e7ebede76393 (patch) | |
| tree | 8034302df7ff2923d95be84beba2951a5789c6bb /src/utils/http.py | |
| parent | utils.http.request_many() shouldn't decode data for Response (diff) | |
| signature | ||
_find_encoding takes `bytes` and soupifies now
Diffstat (limited to 'src/utils/http.py')
| -rw-r--r-- | src/utils/http.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils/http.py b/src/utils/http.py index 8afc3e7e..b21d6e70 100644 --- a/src/utils/http.py +++ b/src/utils/http.py @@ -136,7 +136,8 @@ def _meta_content(s: str) -> typing.Dict[str, str]: out[key] = value return out -def _find_encoding(soup: bs4.BeautifulSoup) -> typing.Optional[str]: +def _find_encoding(data: bytes) -> typing.Optional[str]: + soup = bs4.BeautifulSoup(data) if not soup.meta == None: meta_charset = soup.meta.get("charset") if not meta_charset == None: |
