From 9a6b6c8c49743e0bb9ee95fcbead2d0cb1d82cf8 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 20 Aug 2009 21:50:07 +0200 Subject: [PATCH] ratings can not exist now --- oxweb/imdb.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/oxweb/imdb.py b/oxweb/imdb.py index a599d04..c86ef14 100644 --- a/oxweb/imdb.py +++ b/oxweb/imdb.py @@ -177,12 +177,11 @@ def getMovieInfo(imdbId): info['rating'] = -1 #Votes - votes = findRe(info['user rating'], '([\d,]*?) votes') - if votes: - info['votes'] = int(votes.replace(',', '')) - else: - info['votes'] = -1 - + info['votes'] = -1 + if "user rating" in info: + votes = findRe(info['user rating'], '([\d,]*?) votes') + if votes: + info['votes'] = int(votes.replace(',', '')) return info def getMovieRuntimeSeconds(imdbId):