import requests
import zipfile
import io


def downloadZipFile(url, directory):

    """
    Multimedia Content are stored in cloud in ecar or zip format.
    This function downloads a zip file pointed by url location.
    The user is expected to have access to the file pointed by url.
    The extracted file is available in location specified by directory.
    :param url(str): A valid url pointing to zipped Content location on cloud
    :returns: Status of download.``True``for uccessful download and ``False`` for unsuccesful download
    """
    r = requests.get(url)
    try:
        z = zipfile.ZipFile(io.BytesIO(r.content))
        z.extractall(directory)
        return r.ok
    except BaseException:
        return False