fix plot, fix dont fail in youtube
This commit is contained in:
parent
9cc7b2529d
commit
f26f5de666
2 changed files with 6 additions and 5 deletions
|
@ -257,8 +257,8 @@ def getMovieQuotes(imdbId):
|
||||||
def getMoviePlot(imdbId):
|
def getMoviePlot(imdbId):
|
||||||
url = "%s/plotsummary" % getUrlBase(imdbId)
|
url = "%s/plotsummary" % getUrlBase(imdbId)
|
||||||
data = getUrlUnicode(url)
|
data = getUrlUnicode(url)
|
||||||
plot = findRe(data, '<p class="plotpar">(.*?)<i>')
|
plot = findRe(data, '<p class="plotpar">(.*?)<i>').split('</p>')[0]
|
||||||
return plot
|
return plot.strip()
|
||||||
|
|
||||||
def getMovieTechnical(imdbId):
|
def getMovieTechnical(imdbId):
|
||||||
url = "%s/technical" % getUrlBase(imdbId)
|
url = "%s/technical" % getUrlBase(imdbId)
|
||||||
|
|
|
@ -21,8 +21,9 @@ def getVideoKey(youtubeId):
|
||||||
|
|
||||||
if response.status >= 300 and response.status < 400:
|
if response.status >= 300 and response.status < 400:
|
||||||
location = response.getheader("location")
|
location = response.getheader("location")
|
||||||
return re.match(".*[?&]t=([^&]+)", location).groups()[0]
|
match = re.match(".*[?&]t=([^&]+)", location)
|
||||||
else:
|
if match:
|
||||||
|
return match.groups()[0]
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def getVideoUrl(youtubeId, format='mp4'):
|
def getVideoUrl(youtubeId, format='mp4'):
|
||||||
|
|
Loading…
Reference in a new issue