aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2014-07-06 18:53:31 +0700
committerSergey M․ <dstftw@gmail.com>2014-07-06 18:53:31 +0700
commit76bafa8ffe4631405bba17eb447f366b5c8ce734 (patch)
treefee7b5efa95252f1cc1728528433badb2a1b8f9e /youtube_dl
parent7571c02c8ad38919654d3cdd21ec567f57fe2451 (diff)
[newstube] Capture error message
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/newstube.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/newstube.py b/youtube_dl/extractor/newstube.py
index 2fd5b8f04..a860350af 100644
--- a/youtube_dl/extractor/newstube.py
+++ b/youtube_dl/extractor/newstube.py
@@ -4,6 +4,7 @@ from __future__ import unicode_literals
import re
from .common import InfoExtractor
+from ..utils import ExtractorError
class NewstubeIE(InfoExtractor):
@@ -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