summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-07-06 20:57:05 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-07-06 20:57:05 +0200
commitf4f7e3cf418bf05ecf0ac10ed0db8437b3bc41eb (patch)
treeaf08036e5fca6516277b7ac8ba8d8f920f1b697d
parent8d5797b00f2640cfc5d75ea0189e06d85a360639 (diff)
parent1fd015516e8bb276c798983c243d45b6dd5054dc (diff)
downloadyoutube-dl-f4f7e3cf418bf05ecf0ac10ed0db8437b3bc41eb.tar.gz
youtube-dl-f4f7e3cf418bf05ecf0ac10ed0db8437b3bc41eb.tar.xz
youtube-dl-f4f7e3cf418bf05ecf0ac10ed0db8437b3bc41eb.zip
Merge branch 'master' of github.com:rg3/youtube-dl
-rw-r--r--youtube_dl/extractor/newstube.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/youtube_dl/extractor/newstube.py b/youtube_dl/extractor/newstube.py
index 2fd5b8f04..551bd4d7a 100644
--- a/youtube_dl/extractor/newstube.py
+++ b/youtube_dl/extractor/newstube.py
@@ -4,18 +4,19 @@ from __future__ import unicode_literals
 import re
 
 from .common import InfoExtractor
+from ..utils import ExtractorError
 
 
 class NewstubeIE(InfoExtractor):
     _VALID_URL = r'https?://(?:www\.)?newstube\.ru/media/(?P<id>.+)'
     _TEST = {
-        'url': 'http://newstube.ru/media/na-korable-progress-prodolzhaetsya-testirovanie-sistemy-kurs',
+        'url': 'http://www.newstube.ru/media/telekanal-cnn-peremestil-gorod-slavyansk-v-krym',
         'info_dict': {
-            'id': 'd156a237-a6e9-4111-a682-039995f721f1',
+            'id': '728e0ef2-e187-4012-bac0-5a081fdcb1f6',
             'ext': 'flv',
-            'title': 'На корабле «Прогресс» продолжается тестирование системы «Курс»',
-            'description': 'md5:d0cbe7b4a6f600552617e48548d5dc77',
-            'duration': 20.04,
+            'title': 'Телеканал CNN переместил город Славянск в Крым',
+            'description': 'md5:419a8c9f03442bc0b0a794d689360335',
+            'duration': 31.05,
         },
         'params': {
             # rtmp download
@@ -40,6 +41,10 @@ class NewstubeIE(InfoExtractor):
         def ns(s):
             return s.replace('/', '/%(ns)s') % {'ns': '{http://app1.newstube.ru/N2SiteWS/player.asmx}'}
 
+        error_message = player.find(ns('./ErrorMessage'))
+        if error_message is not None:
+            raise ExtractorError('%s returned error: %s' % (self.IE_NAME, error_message.text), expected=True)
+
         session_id = player.find(ns('./SessionId')).text
         media_info = player.find(ns('./Medias/MediaInfo'))
         title = media_info.find(ns('./Name')).text