[ultimedia] Capture and output unavailable video message
authorSergey M․ <dstftw@gmail.com>
Wed, 18 Mar 2015 18:53:26 +0000 (00:53 +0600)
committerSergey M․ <dstftw@gmail.com>
Wed, 18 Mar 2015 18:53:26 +0000 (00:53 +0600)
youtube_dl/extractor/ultimedia.py

index 97e4445d45efeee351062875c1ec2210d44c16be..0c1b08d7dc5d54e1754802dfa3750bda12c4d068 100644 (file)
@@ -3,6 +3,7 @@ from __future__ import unicode_literals
 
 from .common import InfoExtractor
 from ..utils import (
+    ExtractorError,
     qualities,
     unified_strdate,
     clean_html,
@@ -49,6 +50,10 @@ class UltimediaIE(InfoExtractor):
         deliver_page = self._download_webpage(
             deliver_url, video_id, 'Downloading iframe page')
 
+        if '>This video is currently not available' in deliver_page:
+            raise ExtractorError(
+                'Video %s is currently not available' % video_id, expected=True)
+
         player = self._parse_json(
             self._search_regex(
                 r"jwplayer\('player(?:_temp)?'\)\.setup\(({.+?})\)\.on", deliver_page, 'player'),