From e987e91fcc2437a219834025e12432879e4fd93b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 29 Nov 2014 22:16:35 +0600 Subject: [PATCH] [playvid] Capture and output error message --- youtube_dl/extractor/playvid.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/youtube_dl/extractor/playvid.py b/youtube_dl/extractor/playvid.py index b1322f13f..cd3905acb 100644 --- a/youtube_dl/extractor/playvid.py +++ b/youtube_dl/extractor/playvid.py @@ -4,6 +4,8 @@ import re from .common import InfoExtractor from ..utils import ( + ExtractorError, + clean_html, compat_urllib_parse, ) @@ -28,6 +30,11 @@ class PlayvidIE(InfoExtractor): webpage = self._download_webpage(url, video_id) + m_error = re.search( + r'
\s*
\s*
(?P.+?)
\s*
', webpage) + if m_error: + raise ExtractorError(clean_html(m_error.group('msg')), expected=True) + video_title = None duration = None video_thumbnail = None