get poster

This commit is contained in:
j 2017-05-03 15:02:58 +02:00
parent a09dfe5d4d
commit 4b1fd064f2

View file

@ -180,7 +180,7 @@ class Imdb(SiteParser):
},
'posterId': {
'page': 'combined',
're': '/primary-photo/media/rm(.*?)/tt',
're': '<img.*?id="primary-poster".*?src="(.*?)".*?>',
'type': 'string'
},
'posterIds': {
@ -813,9 +813,9 @@ def get_movie_poster(imdbId):
'''
info = ImdbCombined(imdbId)
if 'posterId' in info:
url = "http://www.imdb.com/media/rm%s/tt%s" % (info['posterId'], imdbId)
data = read_url(url).decode('utf-8', 'ignore')
poster = find_re(data, 'img.*?id="primary-img".*?src="(.*?)"')
poster = info['posterId']
if '@' in poster:
poster = poster.split('@')[0] + '@.jpg'
return poster
elif 'series' in info:
return get_movie_poster(info['series'])