add imdb.getPersonData

This commit is contained in:
j 2008-09-30 16:00:21 +02:00
parent 9e33245ee1
commit ce0d5692c7

View file

@ -702,6 +702,21 @@ def getEpisodeData(title, episode, show_url = None):
episodeData['imdb'] = i['episodes'][episode]['imdb']
return episodeData
def getPersonData(imdbId):
imdbId = normalizeImdbId(imdbId)
url = u'http://www.imdb.com/name/nm%s/' % imdbId
data = getUrlUnicode(url)
info = dict()
info['name'] = findRe(data, u'<title>(.*?)</title>')
filmo = data.split(u'<h3>Additional Details</h3>')[0]
movies = {}
for part in filmo.split(u'<div class="filmo"')[1:]:
section = findRe(part, u'a name=".*?">(.*?):</a></h5>')
section = decodeHtml(section)
movies[section] = re.compile(u'href="/title/tt(\d{7})/"').findall(part)
info['movies'] = movies
return info
if __name__ == '__main__':
import sys
#print parse(sys.argv[1])