python2 fix

This commit is contained in:
j 2019-01-01 21:09:05 +01:00
parent aaf30c35a0
commit 0b9a3966b0

View file

@ -707,7 +707,7 @@ def get_episodes(imdbId, season=None):
url = 'http://www.imdb.com/title/tt%s/episodes' % imdbId url = 'http://www.imdb.com/title/tt%s/episodes' % imdbId
if season: if season:
url += '?season=%d' % season url += '?season=%d' % season
data = cache.read_url(url) data = cache.read_url(url).decode()
for e in re.compile('<div data-const="tt(\d{7})".*?>.*?<div>S(\d+), Ep(\d+)<\/div>\n<\/div>', re.DOTALL).findall(data): for e in re.compile('<div data-const="tt(\d{7})".*?>.*?<div>S(\d+), Ep(\d+)<\/div>\n<\/div>', re.DOTALL).findall(data):
episodes['S%02dE%02d' % (int(e[1]), int(e[2]))] = e[0] episodes['S%02dE%02d' % (int(e[1]), int(e[2]))] = e[0]
else: else: