kopia lustrzana https://github.com/yt-dlp/yt-dlp
[newstube] Capture error message
rodzic
7571c02c8a
commit
76bafa8ffe
|
@ -4,6 +4,7 @@ from __future__ import unicode_literals
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..utils import ExtractorError
|
||||||
|
|
||||||
|
|
||||||
class NewstubeIE(InfoExtractor):
|
class NewstubeIE(InfoExtractor):
|
||||||
|
@ -40,6 +41,10 @@ class NewstubeIE(InfoExtractor):
|
||||||
def ns(s):
|
def ns(s):
|
||||||
return s.replace('/', '/%(ns)s') % {'ns': '{http://app1.newstube.ru/N2SiteWS/player.asmx}'}
|
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
|
session_id = player.find(ns('./SessionId')).text
|
||||||
media_info = player.find(ns('./Medias/MediaInfo'))
|
media_info = player.find(ns('./Medias/MediaInfo'))
|
||||||
title = media_info.find(ns('./Name')).text
|
title = media_info.find(ns('./Name')).text
|
||||||
|
|
Ładowanie…
Reference in New Issue