Trying to get a file export from a request which is in zip format. I want to donwload line by line since later I will be uploading to cloud storage and do not want to store the whole file in memory.
I tried the following:
with requests.get(export_url, stream=True) as response:
for zip_chunk in response.iter_lines():
print(zip_chunk)
for file_name, file_size, unzipped_chunks in stream_unzip(response.iter_lines()):
for chunk in unzipped_chunks:
print(chunk)
However I am getting the following error that I am not sure how to solve or what it means.
UnexpectedSignatureError: b'9Oxb2<'