Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with requests.get(download_link,stream=True, headers=headers) as r:
- r.raise_for_status()
- with open('file.pdf', 'wb') as f:
- for chunk in r.iter_content(chunk_size=8192):
- if chunk: # filter out keep-alive new chunks
- f.write(chunk)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement