get image urls from wikipedia image names

This commit is contained in:
j 2008-07-04 14:14:13 +02:00
parent 7df07d8a61
commit 47820ba939

View file

@ -51,6 +51,17 @@ def getMovieData(wikipediaUrl):
filmbox[key] = value
return filmbox
def getImageUrl(name):
data = getUrlUnicode('http://en.wikipedia.org/wiki/Image:' + name)
url = findRe(data, '="(http://upload.wikimedia.org/.*?)"')
return url
def getMoviePoster(wikipediaUrl):
data = getMovieData(wikipediaUrl)
if 'image' in data:
return getImageUrl(data['image'])
return ''
def getAmgId(wikipediaUrl):
data = getMovieData(wikipediaUrl)
return data.get('amg_id', '')