Aiohttp auto decompression can not be easily disabled
The auto_decompress=True default of aiohttp can't be disabled via session_factory = lambda: AiohttpSession(auto_decompress=False) as that gets in the way of other HTTP requests in the session which rely on a hard-coded Accept-Encoding: gzip; the request object does not take in kwargs in aiogoogle, so it can't pass auto_decompress=False into the individual aiohttp request parameters either.
This flag is used with Google storage when skipping gzip decompression on download_file.
This is not the right way to do it, but shows the behavior I am using for this one very particular use case. It may make sense to simply add an optional request.kwargs object
aiogoogle/sessions/aiohttp_session.py
kwargs = {"auto_decompress": False} if request.media_download else {}
return await self.request(
method=request.method,
url=request.url,
headers=request.headers,
data=request.data,
json=request.json,
timeout=request.timeout,
ssl=request._verify_ssl,
proxy=HTTP_PROXY,
**kwargs
)
Hi @Downchuck
I like your solution. I'll approve and release a new version if you can submit a PR with the proposed change. Thanks!