import re


def is_album(url):
    """ Parses an Imgur URL and returns True if it is an album or directory. """
    domain_pattern = r"(imgur.com/)(a/|gallery/)"
    result = re.search(domain_pattern, url, flags = re.IGNORECASE)
    if result is None:
        return False
    else:
        return True