

def get_movie(self, imdb, title, year):
    try:
        query = (self.search_link % urllib.quote_plus(title))
        query = urlparse.urljoin(self.base_link, query)
        result = client.source(query)
        result = client.parseDOM(result, 'div', attrs={
            'class': 'home_post_cont.+?',
        })
        title = cleantitle.movie(title)
        years = [('(%s)' % str(year)), ('(%s)' % str((int(year) + 1))), ('(%s)' % str((int(year) - 1)))]
        result = [(client.parseDOM(i, 'a', ret='href')[0], client.parseDOM(i, 'img', ret='title')[0]) for i in result]
        result = [(i[0], client.replaceHTMLCodes(i[1])) for i in result]
        result = [(i[0], client.parseDOM(i[1], 'a')) for i in result]
        result = [(i[0], i[1][0]) for i in result if (len(i[1]) > 0)]
        result = [i for i in result if (title == cleantitle.movie(i[1]))]
        result = [i[0] for i in result if any(((x in i[1]) for x in years))][0]
        try:
            url = re.compile('//.+?(/.+)').findall(result)[0]
        except:
            url = result
        url = client.replaceHTMLCodes(url)
        url = url.encode('utf-8')
        return url
    except:
        return

dataset/ETHPy150Open mrknow/filmkodi/plugin.video.specto/resources/lib/sources/movienight_mv.py source.get_movie/original