

def get_episode(self, url, imdb, tvdb, title, date, season, episode):
    try:
        if (url == None):
            return
        (year, month) = re.compile('(\\d{4})-(\\d{2})').findall(date)[(- 1)]
        if (int(year) <= 2008):
            raise Exception()
        cat = urlparse.urljoin(self.base_link, url)
        cat = cat.split('category/', 1)[(- 1)].rsplit('/')[0]
        url = urlparse.urljoin(self.base_link, ('/episode/%s-s%02de%02d' % (cat, int(season), int(episode))))
        result = client.source(url, output='response', error=True)
        if ('404' in result[0]):
            url = urlparse.urljoin(self.base_link, ('/%s/%s/%s-s%02de%02d' % (year, month, cat, int(season), int(episode))))
            result = client.source(url, output='response', error=True)
        if ('404' in result[0]):
            url = urlparse.urljoin(self.base_link, ('/%s/%s/%s-%01dx%01d' % (year, month, cat, int(season), int(episode))))
            result = client.source(url, output='response', error=True)
        if ('404' in result[0]):
            raise Exception()
        try:
            url = re.compile('//.+?(/.+)').findall(url)[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/wsonline_tv.py source.get_episode/original