diff --git a/ox/imdb.py b/ox/imdb.py index 926b2dc..78b84b7 100644 --- a/ox/imdb.py +++ b/ox/imdb.py @@ -12,7 +12,7 @@ import time from BeautifulSoup import BeautifulSoup import chardet import oxutils -from oxutils import stripTags, htmldecode, findRe, findString +from oxutils import stripTags, decodeHtml, findRe, findString from oxutils.cache import getUrl, getUrlUnicode from oxutils.normalize import normalizeTitle, normalizeImdbId @@ -63,7 +63,7 @@ def getMovieInfo(imdbId): title = stripTags(i[0]).strip().lower() txt= stripTags(i[1]).strip() def cleanUp(k): - k = htmldecode(k).replace(u'\xa0', ' ').strip() + k = decodeHtml(k).replace(u'\xa0', ' ').strip() if k.endswith('more'): k=k[:-len('more')].strip() return k txt = cleanUp(txt) @@ -91,7 +91,7 @@ def getMovieInfo(imdbId): if html_title: html_title = str(html_title[0]) html_title = html_title.replace('
', ' ').replace(' ', ' ') - title = htmldecode(html_title) + title = decodeHtml(html_title) title = stripTags(title) year = findRe(title, '\((\d{4})\)') if not year: @@ -210,7 +210,7 @@ def getMovieLocations(imdbId): soup = BeautifulSoup(data) locations = [] for key in soup('a', {'href': re.compile('^/List')}): - locations.append(htmldecode(key.string)) + locations.append(decodeHtml(key.string)) return locations def getMovieImages(imdbId, keys=('still_frame', 'poster', 'product')): @@ -270,7 +270,7 @@ def getMovieKeywords(imdbId): soup = BeautifulSoup(data) keywords = [] for key in soup('a', {'href': re.compile('^/keyword/')}): - k = htmldecode(key.string) + k = decodeHtml(key.string) k = k.replace(u'\xa0', ' ') keywords.append(k) return keywords @@ -509,7 +509,7 @@ class IMDb: episodes[episode]['title'] = match[3].strip() if episodes[episode]['title'].startswith('Episode #%d'%int(match[0])): episodes[episode]['title'] = u'' - description = htmldecode(match[5]) + description = decodeHtml(match[5]) description = stripTags(description.split('Next US airings:')[0]) episodes[episode]['description'] = description episodes[episode]['date'] = ''