get image urls from wikipedia image names
This commit is contained in:
parent
7df07d8a61
commit
47820ba939
1 changed files with 11 additions and 0 deletions
|
@ -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', '')
|
||||
|
|
Loading…
Reference in a new issue