fix movies with only one alternative title
This commit is contained in:
parent
ca9ffcf867
commit
d29f9e3dc8
1 changed files with 5 additions and 3 deletions
|
@ -283,6 +283,11 @@ class Imdb(SiteParser):
|
|||
time.sleep(1)
|
||||
super(Imdb, self).__init__(0)
|
||||
|
||||
if 'alternativeTitles' in self:
|
||||
if len(self['alternativeTitles']) == 2 and \
|
||||
isinstance(self['alternativeTitles'][0], basestring):
|
||||
self['alternativeTitles'] = [self['alternativeTitles']]
|
||||
|
||||
for t in self.get('alternativeTitles', []):
|
||||
for type in t[1].split('/'):
|
||||
type = type.strip()
|
||||
|
@ -317,9 +322,6 @@ class Imdb(SiteParser):
|
|||
if t in self:
|
||||
self[t] = cleanup_title(self[t])
|
||||
if 'alternativeTitles' in self:
|
||||
if len(self['alternativeTitles']) == 2 and \
|
||||
isinstance(self['alternativeTitles'][0], basestring):
|
||||
self['alternativeTitles'] = [self['alternativeTitles']]
|
||||
alt = {}
|
||||
for t in self['alternativeTitles']:
|
||||
title = cleanup_title(t[0])
|
||||
|
|
Loading…
Reference in a new issue