From efa43f84377e22c6e797461e7f745a391f2bd860 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 11 Jul 2009 11:45:31 +0200 Subject: [PATCH] imdb can include things like id= --- oxweb/wikipedia.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/oxweb/wikipedia.py b/oxweb/wikipedia.py index b50cff8..257b87a 100644 --- a/oxweb/wikipedia.py +++ b/oxweb/wikipedia.py @@ -55,11 +55,13 @@ def getMovieData(wikipediaUrl): value = d[1].strip() filmbox[key] = value if 'imdb title' in data: - filmbox['imdb_id'] = findRe(data, 'imdb title\|(\d*?)\|') + filmbox['imdb_id'] = findRe(data, 'imdb title\|.*?(\d*?)\|') if 'Amg movie' in data: - filmbox['amg_id'] = findRe(data, 'Amg movie\|(\d*?)\|') + filmbox['amg_id'] = findRe(data, 'Amg movie\|.*?(\d*?)\|') if 'rotten-tomatoes' in data: filmbox['rottentomatoes_id'] = findRe(data, 'rotten-tomatoes\|id\=(.*?)\|') + if not filmbox['rottentomatoes_id']: + filmbox['rottentomatoes_id'] = findRe(data, 'rotten-tomatoes\|(.*?)\|') return filmbox def getImageUrl(name):