I think we could probably just use this utility function here: https://github.com/Flexget/Flexget/blob/master/flexget/utils/imdb.py#L35