[cineoob] give roles informations in persons_in_common and movies_in_common, imdb and allocine adapted
This commit is contained in:
parent
372da14347
commit
f87a8a685f
5 changed files with 49 additions and 7 deletions
|
|
@ -190,7 +190,8 @@ class AllocineBrowser(Browser):
|
|||
for cast in jres['castMember']:
|
||||
if cast['activity']['$'] not in roles:
|
||||
roles[cast['activity']['$']] = []
|
||||
roles[cast['activity']['$']].append(cast['person']['name'])
|
||||
person_to_append = (u'%s'%cast['person']['code'], cast['person']['name'])
|
||||
roles[cast['activity']['$']].append(person_to_append)
|
||||
|
||||
movie = Movie(id, title)
|
||||
movie.other_titles = other_titles
|
||||
|
|
@ -277,7 +278,8 @@ class AllocineBrowser(Browser):
|
|||
pyear = '????'
|
||||
if 'productionYear' in m['movie']:
|
||||
pyear = m['movie']['productionYear']
|
||||
roles[m['activity']['$']].append(u'(%s) %s' % (pyear, m['movie']['originalTitle']))
|
||||
movie_to_append = (u'%s' % (m['movie']['code']), u'(%s) %s' % (pyear, m['movie']['originalTitle']))
|
||||
roles[m['activity']['$']].append(movie_to_append)
|
||||
|
||||
|
||||
person = Person(id, name)
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class ImdbBrowser(Browser):
|
|||
note = u'%s/10 (%s votes)' % (jres['imdbRating'], jres['imdbVotes'])
|
||||
for r in ['Actors', 'Director', 'Writer']:
|
||||
if '%s' % r in jres.keys():
|
||||
roles['%s' % r] = jres['%s' % r].split(', ')
|
||||
roles['%s' % r] = [('N/A',e) for e in jres['%s' % r].split(', ')]
|
||||
|
||||
movie = Movie(id, title)
|
||||
movie.other_titles = other_titles
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ class PersonPage(Page):
|
|||
category = role_div.attrib.get('data-category')
|
||||
for infos in self.parser.select(self.document.getroot(), 'div#filmography > div.filmo-category-section > div'):
|
||||
if category in infos.attrib.get('id'):
|
||||
roles[role].append(infos.text_content().replace('\n', ' ').strip())
|
||||
roles[role].append(('N/A',infos.text_content().replace('\n', ' ').strip()))
|
||||
return roles
|
||||
|
||||
def iter_movies(self, role_filter=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue