fix for movieposterdb urls that do not exist

This commit is contained in:
Rolux 2009-08-20 20:04:08 +02:00
parent 7202fcb391
commit 1ef34da4d1

View file

@ -23,13 +23,14 @@ def getId(url):
def getPostersByUrl(url): def getPostersByUrl(url):
posters = [] posters = []
html = getUrlUnicode(url) html = getUrlUnicode(url)
results = re.compile('<a href="(http://www.movieposterdb.com/group/.*?)">', re.DOTALL).findall(html) if not "The movie you requested is not found" in html:
for result in results: results = re.compile('<a href="(http://www.movieposterdb.com/group/.*?)">', re.DOTALL).findall(html)
posters += getPostersByUrl(result) for result in results:
results = re.compile('<a href="(http://www.movieposterdb.com/poster/.*?)">', re.DOTALL).findall(html) posters += getPostersByUrl(result)
for result in results: results = re.compile('<a href="(http://www.movieposterdb.com/poster/.*?)">', re.DOTALL).findall(html)
html = getUrlUnicode(result) for result in results:
posters.append(findRe(html, '"(http://www.movieposterdb.com/posters/.*?\.jpg)"')) html = getUrlUnicode(result)
posters.append(findRe(html, '"(http://www.movieposterdb.com/posters/.*?\.jpg)"'))
return posters return posters
def getUrl(id): def getUrl(id):