fall back to storyline for summary
This commit is contained in:
parent
cef85fc4de
commit
03c1191550
1 changed files with 9 additions and 1 deletions
|
@ -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 = [
|
||||
|
|
Loading…
Reference in a new issue