diff --git a/usr/lib/hypnotix/common.py b/usr/lib/hypnotix/common.py index f2c6ac0..9401b4d 100755 --- a/usr/lib/hypnotix/common.py +++ b/usr/lib/hypnotix/common.py @@ -179,7 +179,9 @@ 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: + if response.encoding is None: + response.encoding = response.apparent_encoding + 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