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