A feature-rich command-line audio/video downloader
[naver] Capture and output error message (#4057)
Sergey M․dbd1283d31aa
diff --git a/youtube_dl/extractor/naver.py b/youtube_dl/extractor/naver.pyindex c0231c197b..cb1af9ecc1 100644--- a/youtube_dl/extractor/naver.py+++ b/youtube_dl/extractor/naver.py@@ -7,6 +7,7 @@ from .common import InfoExtractorfrom ..utils import (compat_urllib_parse,ExtractorError,+ clean_html,)@@ -31,6 +32,11 @@ class NaverIE(InfoExtractor):m_id = re.search(r'var rmcPlayer = new nhn.rmcnmv.RMCVideoPlayer\("(.+?)", "(.+?)"',webpage)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')vid = m_id.group(1)key = m_id.group(2)