import requests


def download_from_url(url: str, timeout=None):
    """
    Download file from the URL.
    :param url: URL to download.
    :param timeout: timeout before fail.
    """

    try:
        response = requests.get(url, allow_redirects=True, timeout=timeout)
    except requests.exceptions.SSLError:
        print('Incorrect SSL certificate, trying to download without verifying...')
        response = requests.get(url, allow_redirects=True, verify=False,
                                timeout=timeout)

    if response.status_code != 200:
        raise OSError(str(response))

    return response