import tempfile
import requests
import zipfile


def compress_file(file_urls):
    """
    Download all the files from file_urls list of URLs into a temporary directory
    then compress them into a single .zip file and return the path to the zip file
    """
    # Download the files
    files = []
    for url in file_urls:
        # Download the file and save it to a temporary file
        temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=".gif")
        temp_file.write(requests.get(url).content)
        temp_file.close()
        files.append(temp_file.name)
    # Create a temporary zip file to store the files
    zip_file = tempfile.NamedTemporaryFile(suffix=".zip", delete=False)
    # Write the files to the temporary zip file
    with zipfile.ZipFile(zip_file, "w") as zf:
        for file in files:
            zf.write(f"{file}", f"{file}")
    # Return file path
    return zip_file.name