Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte #320

Open
wabiloo opened this issue Jun 14, 2023 · 2 comments

Comments

@wabiloo
Copy link

wabiloo commented Jun 14, 2023

I get this error when doing
m3u8.load("https://cdn-vod-1.nxplay.com.br/hls/movies/94934c51-70e8-4583-8fac-2e045529c6d6/media_0.mp4/index-v1-a1.m3u8")

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

Not quite sure why...
It seems to be the code in httpclient.py, but can't get my head around it.

@davemevans
Copy link
Contributor

davemevans commented Jun 15, 2023

The response is gzip encoded (the 8b in the error message gives it away, but also see the content-encoding header)

urllib doesn't automatically unzip the data, so a patch will be needed that checks the content encoding and passes it through gzip.decompress or similar.

@wabiloo
Copy link
Author

wabiloo commented Jun 15, 2023

I initially thought that might be the issue, but it seemed to work fine with other gzip encoded responses (but I'd have to double check)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants