mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-10 00:58:17 +02:00
[newstube] Capture error message
This commit is contained in:
parent
7571c02c8a
commit
76bafa8ffe
@ -4,6 +4,7 @@
|
||||
import re
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import ExtractorError
|
||||
|
||||
|
||||
class NewstubeIE(InfoExtractor):
|
||||
@ -40,6 +41,10 @@ def _real_extract(self, url):
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user