Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- resp = requests.get(url, stream=True)
- try:
- for chunk in resp.iter_content(chunk_size=buf_size):
- size += len(chunk)
- temp_file.write(chunk)
- except (StopIteration, requests.exceptions.StreamConsumedError):
- temp_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement