import requests


def get_latest_release_tarball(url):
    """Finds the latest release from Github and downloads it

    Args:
        url (string): an API url containing a JSON response

    Returns:
        string: a url containing the tarball
    """
    res = requests.get(url)
    assets = res.json()["assets"]
    for asset in assets:
        if asset["browser_download_url"][-6:] == "tar.gz":
            return asset["browser_download_url"]
        else:
            pass
    return "Latest tarball not found!"