youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit e987e91fcc2437a219834025e12432879e4fd93b
parent cb6444e1971f001d14683e5040beccbf1d253d94
Author: Sergey M․ <dstftw@gmail.com>
Date:   Sat, 29 Nov 2014 22:16:35 +0600

[playvid] Capture and output error message

Diffstat:
Myoutube_dl/extractor/playvid.py | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git 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'<div class="block-error">\s*<div class="heading">\s*<div>(?P<msg>.+?)</div>\s*</div>', webpage) + if m_error: + raise ExtractorError(clean_html(m_error.group('msg')), expected=True) + video_title = None duration = None video_thumbnail = None