display a meaningful error message on rental videos (#359)
[youtube-dl] / youtube_dl / InfoExtractors.py
index 40f96ad76590bc732c4d5c422d1d839fe6eb9986..d02bd29f74d79abd2f194bcf60bab81e2319fa8a 100644 (file)
@@ -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)