dmitriiweb
2/15/2018 - 9:59 AM

requests_download_file.py

requests shutil download file

import requests
import shutil

r = requests.get('url', stream=True)
if r.status_code == 200:
    with open(path, 'wb') as f:
        r.raw.decode_content = True
        shutil.copyfileobj(r.raw, f)