fix release date for 0107394

This commit is contained in:
j 2008-11-11 01:34:34 +01:00
parent 3c82645837
commit 9cc7b2529d
2 changed files with 3 additions and 1 deletions

View File

@ -92,6 +92,8 @@ def getMovieInfo(imdbId):
if key in info:
del info[key]
if 'release date' in info:
if isinstance(info['release date'], list):
info['release date'] = info['release date'][0]
info['release date'] = info['release date'].split('\n')[0]
if 'plot' in info:
info['plot'] = info['plot'].split('| add synopsis')[0].strip()

View File

@ -85,7 +85,7 @@ def find(query, max_results=10):
data = getUrl(url, timeout=0)
result = simplejson.loads(data)
results = []
if result:
if result and 'query' in result:
for r in result['query']['search']:
title = r['title']
url = "http://en.wikipedia.org/wiki/%s" % title.replace(' ', '_')