fix plot, fix dont fail in youtube

This commit is contained in:
j 2008-12-07 15:39:39 +01:00
parent 9cc7b2529d
commit f26f5de666
2 changed files with 6 additions and 5 deletions

View File

@ -257,8 +257,8 @@ def getMovieQuotes(imdbId):
def getMoviePlot(imdbId):
url = "%s/plotsummary" % getUrlBase(imdbId)
data = getUrlUnicode(url)
plot = findRe(data, '<p class="plotpar">(.*?)<i>')
return plot
plot = findRe(data, '<p class="plotpar">(.*?)<i>').split('</p>')[0]
return plot.strip()
def getMovieTechnical(imdbId):
url = "%s/technical" % getUrlBase(imdbId)

View File

@ -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)