From 9cc7b2529d8ac0510b5c892b3f47da3c24d57886 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 11 Nov 2008 01:34:34 +0100 Subject: [PATCH] fix release date for 0107394 --- oxweb/imdb.py | 2 ++ oxweb/wikipedia.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/oxweb/imdb.py b/oxweb/imdb.py index 86863be..dab184b 100644 --- a/oxweb/imdb.py +++ b/oxweb/imdb.py @@ -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() diff --git a/oxweb/wikipedia.py b/oxweb/wikipedia.py index 36a838f..c79220b 100644 --- a/oxweb/wikipedia.py +++ b/oxweb/wikipedia.py @@ -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(' ', '_')