def parse_media_type(file_ext, EXT):
    """
    Given a file extension, get the type of media
    One of 'photo', 'video' or 'remove'

    file_ext {str}: file extension to parse
    EXT {Extension}: Extension object
    type of media {str}
    """
    for attr_name in [x for x in dir(EXT) if not x.startswith('__')]:
        if file_ext in getattr(EXT, attr_name):
            return attr_name

    raise Exception(f'Invalid extension: {file_ext}')