mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-12-27 21:59:17 +01:00
[xvideos] Capture and output inline error if any
This commit is contained in:
parent
24da5893fc
commit
3217377b3c
1 changed files with 6 additions and 0 deletions
|
@ -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'<h1 class="inlineError">(.+?)</h1>', 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'))
|
||||
|
|
Loading…
Reference in a new issue