Is there a way to use Brotli decompression?
#1
Kodi has that module for HTTP requests, script.module.requests.

Many servers today prefer to use Brotli ("br") content-encoding, while Requests only supports gzip and deflate encoding.

Has anyone been able to decompress Brotli data from Python using a Kodi add-on? My concern is Kodi on mobile platforms, since the Brotli binaries would have to be built for them and that's outside my skillset.
Reply
#2
I see there are Brotli python bindings, and those could be made into a module for Kodi, but you would still have to check and see if the local OS has the needed binaries to be able to use it.  And you'd either have to stop using Requests or patch Requests to support it.  I think that's a somewhat long way of saying "probably not" at least not in any meaningful cross-platform way.

It seems like the servers should allow you to request a compression method in the header to avoid this problem.
Reply
#3
binary python modules have many issues to get working properly on all kodi platforms to use something like httpx[brotli].
Possibly you could find/make a pure python decoder that would be slow but would work in a pinch.
Reply
#4
brotli libs would have to be added to the kodi build system and shipped with kodi. It's not possible to do that in a python addon
Reply

Logout Mark Read Team Forum Stats Members Help
Is there a way to use Brotli decompression?0