diff --git a/usr/lib/hypnotix/common.py b/usr/lib/hypnotix/common.py index f2c6ac0..2bf1347 100755 --- a/usr/lib/hypnotix/common.py +++ b/usr/lib/hypnotix/common.py @@ -179,7 +179,8 @@ def get_playlist(self, provider, refresh=False) -> bool: # Set stream blocks block_bytes = int(4 * 1024 * 1024) # 4 MB - with open(provider.path, "w", encoding="utf-8") as file: + response.encoding = response.encoding or response.apparent_encoding or "utf-8" + with open(provider.path, "w", encoding=response.encoding) as file: # Grab data by block_bytes for data in response.iter_content(block_bytes, decode_unicode=True): downloaded_bytes += block_bytes