use request.iter_content

This commit is contained in:
j 2024-05-22 08:21:01 +02:00
parent e850296f68
commit 6b22e2ec29

View file

@ -126,7 +126,7 @@ class API(object):
tmpname = filename + '.tmp'
with open(tmpname, 'wb') as fd:
r = self._requests_session.get(url)
for chunk in iter(lambda: r.read(chunk_size), b''):
for chunk in r.iter_content(chunk_size=chunk_size):
fd.write(chunk)
shutil.move(tmpname, filename)