'Search the IMDB ID for the given `title` and `year`.
:param str title: title to search for.
:param int year: year to search for (or 0 if not relevant).
:param bool is_movie: If True, IMDB ID will be searched for in TMDB instead of TheWiz.
:return: the IMDB ID for the given title and year (or None if not found).
:rtype: str'

def _search_imdb_id(self, title, year, is_movie):

    logger.info('Searching    IMDB    ID    for    %r%r', title, ('' if (not year) else '    ({})'.format(year)))
    title = title.replace("'", '')
    if is_movie:
        r = self.session.get('http://api.tmdb.org/3/search/movie?api_key={}&query={}{}&language=en'.format(self._tmdb_api_key, title, ('' if (not year) else '&year={}'.format(year))))
        r.raise_for_status()
        tmdb_results = r.json().get('results')
        if tmdb_results:
            tmdb_id = tmdb_results[0].get('id')
            if tmdb_id:
                r = self.session.get('http://api.tmdb.org/3/movie/{}?api_key={}&language=en'.format(tmdb_id, self._tmdb_api_key))
                r.raise_for_status()
                return (str(r.json().get('imdb_id', '')) or None)
        return None
    r = self.session.get((self.server_url + 'search.tv.php'), params={'name': title}, timeout=10)
    r.raise_for_status()
    return (r.text or None)
