[imdb] conversion working but not satisfying
This commit is contained in:
parent
36dac32557
commit
57ec280f7c
1 changed files with 21 additions and 4 deletions
|
|
@ -53,11 +53,11 @@ class ImdbBrowser(BaseBrowser):
|
||||||
short_description = u'%s %s'%(tdesc.split('<')[0].strip(', '), tdesc.split('>')[1].split('<')[0])
|
short_description = u'%s %s'%(tdesc.split('<')[0].strip(', '), tdesc.split('>')[1].split('<')[0])
|
||||||
else:
|
else:
|
||||||
short_description = tdesc.strip(', ')
|
short_description = tdesc.strip(', ')
|
||||||
movie = Movie(m['id'],unicode(m['title']))
|
movie = Movie(m['id'],latin2unicode(m['title']))
|
||||||
movie.other_titles = NotLoaded
|
movie.other_titles = NotLoaded
|
||||||
movie.release_date = NotLoaded
|
movie.release_date = NotLoaded
|
||||||
movie.duration = NotLoaded
|
movie.duration = NotLoaded
|
||||||
movie.short_description = short_description
|
movie.short_description = latin2unicode(short_description)
|
||||||
movie.pitch = NotLoaded
|
movie.pitch = NotLoaded
|
||||||
movie.country = NotLoaded
|
movie.country = NotLoaded
|
||||||
movie.note = NotLoaded
|
movie.note = NotLoaded
|
||||||
|
|
@ -70,7 +70,7 @@ class ImdbBrowser(BaseBrowser):
|
||||||
for cat in ['name_popular','name_exact','name_approx']:
|
for cat in ['name_popular','name_exact','name_approx']:
|
||||||
if jres.has_key(cat):
|
if jres.has_key(cat):
|
||||||
for p in jres[cat]:
|
for p in jres[cat]:
|
||||||
person = Person(p['id'],unicode(p['name']))
|
person = Person(p['id'],latin2unicode(p['name']))
|
||||||
person.real_name = NotLoaded
|
person.real_name = NotLoaded
|
||||||
person.birth_place = NotLoaded
|
person.birth_place = NotLoaded
|
||||||
person.birth_date = NotLoaded
|
person.birth_date = NotLoaded
|
||||||
|
|
@ -78,7 +78,7 @@ class ImdbBrowser(BaseBrowser):
|
||||||
person.gender = NotLoaded
|
person.gender = NotLoaded
|
||||||
person.nationality = NotLoaded
|
person.nationality = NotLoaded
|
||||||
person.short_biography= NotLoaded
|
person.short_biography= NotLoaded
|
||||||
person.short_description= unicode(p['description'])
|
person.short_description= latin2unicode(p['description'])
|
||||||
person.roles = NotLoaded
|
person.roles = NotLoaded
|
||||||
yield person
|
yield person
|
||||||
|
|
||||||
|
|
@ -180,3 +180,20 @@ class ImdbBrowser(BaseBrowser):
|
||||||
assert self.is_on_page(MovieCrewPage)
|
assert self.is_on_page(MovieCrewPage)
|
||||||
for person in self.page.iter_persons_ids():
|
for person in self.page.iter_persons_ids():
|
||||||
yield person
|
yield person
|
||||||
|
|
||||||
|
|
||||||
|
dict_hex = {'á': u'á',
|
||||||
|
'é': u'é',
|
||||||
|
'è': u'è',
|
||||||
|
'í': u'í',
|
||||||
|
'ñ': u'ñ',
|
||||||
|
'ó': u'ó',
|
||||||
|
'ú': u'ú',
|
||||||
|
'ü': u'ü',
|
||||||
|
'&': u'&',
|
||||||
|
'ç': u'ç'
|
||||||
|
}
|
||||||
|
def latin2unicode(word):
|
||||||
|
for key in dict_hex.keys():
|
||||||
|
word = word.replace(key,dict_hex[key])
|
||||||
|
return unicode(word)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue