def get_library(phrase, lib, localize, devices):
    """ Return the library type if the phrase contains related keywords. """
    for device in devices:
        if device.lower() in phrase:
            phrase = phrase.replace(device.lower(), "")
    tv_keywords = localize["shows"] + \
        localize["season"]["keywords"] + localize["episode"]["keywords"]
    if any(word in phrase for word in tv_keywords):
        return lib["shows"]
    elif any(word in phrase for word in localize["movies"]):
        return lib["movies"]
    return None