import re


def prepare_urls(exposes):
    """Turns object ids into urls.

    Args:
        exposes (list): str representing object ids

    Returns:
        list: urls of objects
    """

    if re.findall(r".txt$", exposes):
        with open(exposes, "r") as f:
            exposes = f.read()
        if len(exposes) == 0:
            print("The file containing exposes could not be read.")

    exposes = exposes.split(sep=" ")
    url_root = "https://www.immowelt.de/expose/"
    return [url_root + a for a in exposes]