def name_to_id(media_type_name):
        """Convert a media type name to its ID"""
        try:
            return MediaTypes.__media_type_map[media_type_name]
        except KeyError:
            raise ValueError('Invalid media name')
Convert a media type name to its ID
instagram_private_api/endpoints/common.py