]> gitweb @ CieloNegro.org - youtube-dl.git/blobdiff - youtube_dl/InfoExtractors.py
Merge pull request #363 from chalet16/master
[youtube-dl.git] / youtube_dl / InfoExtractors.py
index 0fc39163ee2a74131ed84442c68f388a72fad0f1..0b5d76bdbd89f393340afdec9e0a79b86df615c8 100644 (file)
@@ -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)
 
@@ -2450,7 +2455,7 @@ class SoundcloudIE(InfoExtractor):
                        try:
                                upload_date = datetime.datetime.strptime(mobj.group(1), '%B %d, %Y %H:%M').strftime('%Y%m%d')
                        except Exception, e:
-                               print str(e)
+                               self._downloader.to_stderr(str(e))
 
                # for soundcloud, a request to a cross domain is required for cookies
                request = urllib2.Request('http://media.soundcloud.com/crossdomain.xml', std_headers)