diff --git a/oxweb/imdb.py b/oxweb/imdb.py index dab184b..63dbe04 100644 --- a/oxweb/imdb.py +++ b/oxweb/imdb.py @@ -257,8 +257,8 @@ def getMovieQuotes(imdbId): def getMoviePlot(imdbId): url = "%s/plotsummary" % getUrlBase(imdbId) data = getUrlUnicode(url) - plot = findRe(data, '

(.*?)') - return plot + plot = findRe(data, '

(.*?)').split('

')[0] + return plot.strip() def getMovieTechnical(imdbId): url = "%s/technical" % getUrlBase(imdbId) diff --git a/oxweb/youtube.py b/oxweb/youtube.py index 31e388e..fccfdb4 100644 --- a/oxweb/youtube.py +++ b/oxweb/youtube.py @@ -21,9 +21,10 @@ def getVideoKey(youtubeId): if response.status >= 300 and response.status < 400: location = response.getheader("location") - return re.match(".*[?&]t=([^&]+)", location).groups()[0] - else: - return False + match = re.match(".*[?&]t=([^&]+)", location) + if match: + return match.groups()[0] + return False def getVideoUrl(youtubeId, format='mp4'): youtubeKey = getVideoKey(youtubeId)