mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-25 12:45:51 +01:00
[naver] Capture and output error message (#4057)
This commit is contained in:
parent
c451d4f553
commit
dbd1283d31
@ -7,6 +7,7 @@
|
|||||||
from ..utils import (
|
from ..utils import (
|
||||||
compat_urllib_parse,
|
compat_urllib_parse,
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
|
clean_html,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -31,6 +32,11 @@ def _real_extract(self, url):
|
|||||||
m_id = re.search(r'var rmcPlayer = new nhn.rmcnmv.RMCVideoPlayer\("(.+?)", "(.+?)"',
|
m_id = re.search(r'var rmcPlayer = new nhn.rmcnmv.RMCVideoPlayer\("(.+?)", "(.+?)"',
|
||||||
webpage)
|
webpage)
|
||||||
if m_id is None:
|
if m_id is None:
|
||||||
|
m_error = re.search(
|
||||||
|
r'(?s)<div class="nation_error">\s*(?:<!--.*?-->)?\s*<p class="[^"]+">(?P<msg>.+?)</p>\s*</div>',
|
||||||
|
webpage)
|
||||||
|
if m_error:
|
||||||
|
raise ExtractorError(clean_html(m_error.group('msg')), expected=True)
|
||||||
raise ExtractorError('couldn\'t extract vid and key')
|
raise ExtractorError('couldn\'t extract vid and key')
|
||||||
vid = m_id.group(1)
|
vid = m_id.group(1)
|
||||||
key = m_id.group(2)
|
key = m_id.group(2)
|
||||||
|
Loading…
Reference in New Issue
Block a user