X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=youtube_dl%2FInfoExtractors.py;h=0b5d76bdbd89f393340afdec9e0a79b86df615c8;hb=65dc7d027278d93b4a760dcbf6d19067fb8ff85d;hp=ee8783ffd6bd3ad5ce72f4c93216e25f415ea07b;hpb=1b91a2e2cfa3b9277205eb9652e5a2f0b40a0016;p=youtube-dl.git diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index ee8783ffd..0b5d76bdb 100644 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -181,8 +181,8 @@ class YoutubeIE(InfoExtractor): start = "%02i:%02i:%02i,%03i" %(start/(60*60), start/60%60, start%60, start%1*1000) end = "%02i:%02i:%02i,%03i" %(end/(60*60), end/60%60, end%60, end%1*1000) caption = unescapeHTML(caption) - caption = unescapeHTML(caption) # double cycle, inentional - srt += str(n) + '\n' + caption = unescapeHTML(caption) # double cycle, intentional + srt += str(n+1) + '\n' srt += start + ' --> ' + end + '\n' srt += caption + '\n\n' return srt @@ -311,6 +311,11 @@ class YoutubeIE(InfoExtractor): self._downloader.trouble(u'ERROR: "token" parameter not in video info for unknown reason') return + # Check for "rental" videos + if 'ypc_video_rental_bar_text' in video_info and 'author' not in video_info: + self._downloader.trouble(u'ERROR: "rental" videos not supported') + return + # Start extracting information self.report_information_extraction(video_id) @@ -2188,11 +2193,12 @@ class EscapistIE(InfoExtractor): self.report_extraction(showName) try: - webPage = urllib2.urlopen(url).read() + webPageBytes = urllib2.urlopen(url).read() except (urllib2.URLError, httplib.HTTPException, socket.error), err: self._downloader.trouble(u'ERROR: unable to download webpage: ' + unicode(err)) return + webPage = webPageBytes.decode('utf-8') descMatch = re.search('