fall back to storyline for summary

This commit is contained in:
j 2019-11-15 14:51:32 +01:00
parent cef85fc4de
commit 03c1191550

View file

@ -199,6 +199,11 @@ class Imdb(SiteParser):
'summary': zebra_table('Plot Summary', more=[
'<p>(.*?)<em'
]),
'storyline': {
'page': '',
're': '<h2>Storyline</h2>.*?<p>(.*?)</p>',
'type': 'string'
},
'posterId': {
'page': 'reference',
're': '<img.*?class="titlereference-primary-image".*?src="(.*?)".*?>',
@ -517,10 +522,13 @@ class Imdb(SiteParser):
])
if self['releasedate'] == 'x':
del self['releasedate']
if 'summary' not in self and 'storyline' in self:
self['summary'] = self.pop('storyline')
if 'summary' in self:
if isinstance(self['summary'], list):
self['summary'] = self['summary'][0]
self['summary'] = self['summary'].split('</p')[0].strip()
self['summary'] = strip_tags(self['summary'].split('</p')[0]).split(' Written by\n')[0].strip()
if 'credits' in self:
credits = [