Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import shutil
- def download_file(url):
- local_filename = url.split('/')[-1]
- r = requests.get(url, stream=True)
- with open(local_filename, 'wb') as f:
- shutil.copyfileobj(r.raw, f)
- return local_filename
Add Comment
Please, Sign In to add comment