From 10d3783673fec70ae43de40a990f7d178f19a433 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 31 May 2009 22:28:01 +0200 Subject: [PATCH] never update imdb cache for now --- oxweb/imdb.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/oxweb/imdb.py b/oxweb/imdb.py index 53393d2..a642421 100644 --- a/oxweb/imdb.py +++ b/oxweb/imdb.py @@ -10,12 +10,17 @@ from BeautifulSoup import BeautifulSoup import chardet import oxlib from oxlib import stripTags, decodeHtml, findRe, findString -from oxlib.cache import getUrl, getUrlUnicode +import oxlib.cache from oxlib.normalize import normalizeTitle, normalizeImdbId from oxlib import * import google +''' + never timeout imdb data, to update cache remove data from cache folder +''' +def getUrlUnicode(url, data=None, headers=oxlib.cache.DEFAULT_HEADERS, timeout=-1): + return oxlib.cache.getUrlUnicode(url, data, headers, timeout) def getMovieId(title, director='', year=''): ''' @@ -330,7 +335,7 @@ def getMovieTrivia(imdbId): def getMovieConnections(imdbId): url = "%s/movieconnections" % getUrlBase(imdbId) - data = getUrl(url) + data = getUrlUnicode(url) connections={} for c in re.compile('''
(.*?)
(.*?)\n\n''', re.DOTALL).findall(data): connections[unicode(c[0])] = re.compile('''''').findall(c[1])