From: Sergey M․ Date: Fri, 6 Jun 2014 14:15:06 +0000 (+0700) Subject: [xvideos] Capture and output inline error if any X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=3217377b3c1e0b0b67f85ce8ec808f6c5cf0c5ae;p=youtube-dl [xvideos] Capture and output inline error if any --- diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dl/extractor/xvideos.py index 85e99e1b0..f21e0671f 100644 --- a/youtube_dl/extractor/xvideos.py +++ b/youtube_dl/extractor/xvideos.py @@ -5,6 +5,8 @@ import re from .common import InfoExtractor from ..utils import ( compat_urllib_parse, + ExtractorError, + clean_html, ) @@ -28,6 +30,10 @@ class XVideosIE(InfoExtractor): self.report_extraction(video_id) + mobj = re.search(r'

(.+?)

', webpage) + if mobj: + raise ExtractorError('%s said: %s' % (self.IE_NAME, clean_html(mobj.group(1))), expected=True) + # Extract video URL video_url = compat_urllib_parse.unquote( self._search_regex(r'flv_url=(.+?)&', webpage, 'video URL'))