[qcineoob] thumbnail for person and movie
This commit is contained in:
parent
7a917e879c
commit
d874a3087a
8 changed files with 41 additions and 144 deletions
|
|
@ -73,7 +73,7 @@ class ImdbBackend(BaseBackend, ICapCinema):
|
|||
if 'real_name' in fields or 'birth_place' in fields\
|
||||
or 'death_date' in fields or 'nationality' in fields\
|
||||
or 'short_biography' in fields or 'roles' in fields\
|
||||
or 'birth_date' in fields\
|
||||
or 'birth_date' in fields or 'thumbnail_url' in fields\
|
||||
or 'gender' in fields or fields == None:
|
||||
per = self.get_person(person.id)
|
||||
person.real_name = per.real_name
|
||||
|
|
@ -85,6 +85,7 @@ class ImdbBackend(BaseBackend, ICapCinema):
|
|||
person.short_biography = per.short_biography
|
||||
person.short_description = per.short_description
|
||||
person.roles = per.roles
|
||||
person.thumbnail_url = per.thumbnail_url
|
||||
|
||||
if 'biography' in fields:
|
||||
person.biography = self.get_person_biography(person.id)
|
||||
|
|
@ -94,7 +95,8 @@ class ImdbBackend(BaseBackend, ICapCinema):
|
|||
def fill_movie(self, movie, fields):
|
||||
if 'other_titles' in fields or 'release_date' in fields\
|
||||
or 'duration' in fields or 'country' in fields\
|
||||
or 'roles' in fields or 'note' in fields:
|
||||
or 'roles' in fields or 'note' in fields\
|
||||
or 'thumbnail_url' in fields:
|
||||
mov = self.get_movie(movie.id)
|
||||
movie.other_titles = mov.other_titles
|
||||
movie.release_date = mov.release_date
|
||||
|
|
@ -104,6 +106,7 @@ class ImdbBackend(BaseBackend, ICapCinema):
|
|||
movie.note = mov.note
|
||||
movie.roles = mov.roles
|
||||
movie.short_description= mov.short_description
|
||||
movie.thumbnail_url = mov.thumbnail_url
|
||||
|
||||
if 'all_release_dates' in fields:
|
||||
movie.all_release_dates = self.get_movie_releases(movie.id)
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ class ImdbBrowser(BaseBrowser):
|
|||
movie.note = NotLoaded
|
||||
movie.roles = NotLoaded
|
||||
movie.all_release_dates= NotLoaded
|
||||
movie.thumbnail_url = NotLoaded
|
||||
yield movie
|
||||
|
||||
def iter_persons(self, pattern):
|
||||
|
|
@ -82,6 +83,7 @@ class ImdbBrowser(BaseBrowser):
|
|||
person.short_biography= NotLoaded
|
||||
person.short_description= latin2unicode(p['description'])
|
||||
person.roles = NotLoaded
|
||||
person.thumbnail_url = NotLoaded
|
||||
yield person
|
||||
|
||||
def get_movie(self, id):
|
||||
|
|
@ -209,6 +211,9 @@ dict_hex = {'á': u'á',
|
|||
'ü': u'ü',
|
||||
'&': u'&',
|
||||
''': u"'",
|
||||
'à': u'à',
|
||||
'À': u'À',
|
||||
'â': u'â',
|
||||
'ç': u'ç'
|
||||
}
|
||||
def latin2unicode(word):
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ class MovieCrewPage(BasePage):
|
|||
person.nationality = NotLoaded
|
||||
person.short_biography= NotLoaded
|
||||
person.roles = NotLoaded
|
||||
person.thumbnail_url = NotLoaded
|
||||
yield person
|
||||
|
||||
for gloss_link in self.parser.select(self.document.getroot(),'table[cellspacing=1] h5 a'):
|
||||
|
|
@ -135,6 +136,7 @@ class PersonPage(BasePage):
|
|||
death_date = NotAvailable
|
||||
real_name = NotAvailable
|
||||
gender = NotAvailable
|
||||
thumbnail_url = NotAvailable
|
||||
roles = {}
|
||||
nationality = NotAvailable
|
||||
td_overview = self.parser.select(self.document.getroot(),'td#overview-top',1)
|
||||
|
|
@ -171,6 +173,10 @@ class PersonPage(BasePage):
|
|||
dtime.append('1')
|
||||
dtime.append('1')
|
||||
death_date = datetime(int(dtime[0]),int(dtime[1]),int(dtime[2]))
|
||||
img_thumbnail = self.parser.select(self.document.getroot(),'td#img_primary img')
|
||||
if len(img_thumbnail) > 0:
|
||||
thumbnail_url = unicode(img_thumbnail[0].attrib.get('src',''))
|
||||
|
||||
# go to the filmography page
|
||||
self.browser.location('http://www.imdb.com/name/%s/filmotype'%id)
|
||||
assert self.browser.is_on_page(FilmographyPage)
|
||||
|
|
@ -186,6 +192,7 @@ class PersonPage(BasePage):
|
|||
person.short_biography = short_biography
|
||||
person.short_description = short_description
|
||||
person.roles = roles
|
||||
person.thumbnail_url = thumbnail_url
|
||||
return person
|
||||
|
||||
class FilmographyPage(BasePage):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue