def id_to_name(media_type_id):
        """Convert a media type ID to its name"""
        try:
            return [k for k, v in MediaTypes.__media_type_map.items() if v == media_type_id][0]
        except IndexError:
            raise ValueError('Invalid media ID')
Convert a media type ID to its name
instagram_private_api/endpoints/common.py