def download_file(url, local_path):
    """Downloads a file to the give path."""
    # NOTE the stream=True parameter below
    print("Downloading and save to %s" % local_path)
    with requests.get(url, stream=True) as req:
        req.raise_for_status()
        with open(local_path, "wb") as file_d:
            for chunk in req.iter_content(chunk_size=8192 * 16):
                # If you have chunk encoded response uncomment if
                # and set chunk_size parameter to None.
                # if chunk:
                # sys.stdout.write(".")
                file_d.write(chunk)
        print("Download completed.")
    return local_path
Downloads a file to the give path.
airtest/utils/ffmpeg/ffmpeg_setter.py