diff --git a/CHANGELOG.md b/CHANGELOG.md index 171ef818..a9b48432 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.19.3 - 2025-04-28] + +### Fixed + +- Method `download2stream` not working correctly when Nextcloud returns compressed content. #352 Thanks to @PatrickPromitzer for reporting this. + ## [0.19.2 - 2025-03-17] ### Added diff --git a/nc_py_api/_session.py b/nc_py_api/_session.py index ecedd7da..cdaa42a6 100644 --- a/nc_py_api/_session.py +++ b/nc_py_api/_session.py @@ -307,7 +307,7 @@ def download2fp(self, url_path: str, fp, dav: bool, params=None, **kwargs): adapter = self.adapter_dav if dav else self.adapter with adapter.stream("GET", url_path, params=params, headers=kwargs.get("headers")) as response: check_error(response) - for data_chunk in response.iter_raw(chunk_size=kwargs.get("chunk_size", 5 * 1024 * 1024)): + for data_chunk in response.iter_bytes(chunk_size=kwargs.get("chunk_size", 5 * 1024 * 1024)): fp.write(data_chunk) @@ -434,7 +434,7 @@ async def download2fp(self, url_path: str, fp, dav: bool, params=None, **kwargs) adapter = self.adapter_dav if dav else self.adapter async with adapter.stream("GET", url_path, params=params, headers=kwargs.get("headers")) as response: check_error(response) - async for data_chunk in response.aiter_raw(chunk_size=kwargs.get("chunk_size", 5 * 1024 * 1024)): + async for data_chunk in response.aiter_bytes(chunk_size=kwargs.get("chunk_size", 5 * 1024 * 1024)): fp.write(data_chunk)