fix wikipedia poster urls

This commit is contained in:
j 2012-07-07 18:03:02 +02:00
parent daf79e8d52
commit b12e6f1b5c

View file

@ -101,8 +101,13 @@ def getMovieData(wikipediaUrl):
return filmbox
def getImageUrl(name):
data = readUrlUnicode('http://en.wikipedia.org/wiki/Image:' + name)
url = 'http://en.wikipedia.org/wiki/Image:' + name.replace(' ', '%20')
data = readUrlUnicode(url)
url = findRe(data, 'href="(http://upload.wikimedia.org/.*?)"')
if not url:
url = findRe(data, 'href="(//upload.wikimedia.org/.*?)"')
if url:
url = 'http:' + url
return url
def getPosterUrl(wikipediaUrl):