import requests


def download_file(url, destination, headers=None, verify=True):
    """ Downloads a file. """

    h = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'}
    if headers is not None:
        h.update(headers)

    resp = requests.get(url, stream=True, headers=h, timeout=(6, 27), verify=verify)
    for chunk in resp.iter_content(chunk_size=4096):
        if chunk:
            destination.write(chunk)

    destination.seek(0)
    return destination, resp.headers