Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

request download file

import requests
import shutil

def download_file(url):
    local_filename = url.split('/')[-1]
    with requests.get(url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)

    return local_filename
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #request #download #file
ADD COMMENT
Topic
Name
5+3 =