add imdb.getPersonData
This commit is contained in:
parent
9e33245ee1
commit
ce0d5692c7
1 changed files with 15 additions and 0 deletions
|
@ -702,6 +702,21 @@ def getEpisodeData(title, episode, show_url = None):
|
||||||
episodeData['imdb'] = i['episodes'][episode]['imdb']
|
episodeData['imdb'] = i['episodes'][episode]['imdb']
|
||||||
return episodeData
|
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__':
|
if __name__ == '__main__':
|
||||||
import sys
|
import sys
|
||||||
#print parse(sys.argv[1])
|
#print parse(sys.argv[1])
|
||||||
|
|
Loading…
Reference in a new issue