From 4e38581c515022a6c6678cd80290e679dbb0e34e Mon Sep 17 00:00:00 2001 From: j Date: Fri, 23 Oct 2009 20:53:48 +0200 Subject: [PATCH] fix trivia and external reviews --- oxweb/imdb.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/oxweb/imdb.py b/oxweb/imdb.py index 9ad2b16..2f7225a 100644 --- a/oxweb/imdb.py +++ b/oxweb/imdb.py @@ -359,7 +359,8 @@ def getMoviePosters(imdbId): def getMovieTrivia(imdbId): url = "%strivia" % getUrlBase(imdbId) data = readUrlUnicode(url) - trivia = re.compile('
  • (.*?)
  • ').findall(data) + data = findRe(data, '') + trivia = re.compile('
  • (.*?)
  • ', re.DOTALL).findall(data) def clean(t): t = decodeHtml(t) t = t.replace(u'”', '"') @@ -390,7 +391,8 @@ def getMovieKeywords(imdbId): def getMovieExternalReviews(imdbId): url = "%sexternalreviews" % getUrlBase(imdbId) data = readUrlUnicode(url) - _reviews = re.compile('
  • (.*?)
  • ').findall(data) + data = findRe(data, '
      (.*?)
    ') + _reviews = re.compile('
  • (.*?)
  • ').findall(data) reviews = {} for r in _reviews: reviews[r[0]] = r[1]