mirror of
https://github.com/StevenBlack/hosts.git
synced 2024-07-07 13:02:27 +02:00
Tell requests to detect encoding.
Changed the get_file_by_url function to infer/guess the encoding of the content we receive.
This commit is contained in:
parent
5186071948
commit
79bd7d4122
@ -1467,7 +1467,9 @@ def maybe_copy_example_file(file_path):
|
||||
|
||||
|
||||
def get_file_by_url(url, params, **kwargs):
|
||||
return requests.get(url=url, params=params, **kwargs).text
|
||||
req = requests.get(url=url, params=params, **kwargs)
|
||||
req.encoding = req.apparent_encoding
|
||||
return req.text
|
||||
|
||||
|
||||
def write_data(f, data):
|
||||
|
Loading…
Reference in New Issue
Block a user