aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/naver.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-10-01 02:33:48 +0600
committerSergey M․ <dstftw@gmail.com>2015-10-01 02:33:48 +0600
commitf540b937062a4de2cd0a097245ec82dd9fd23277 (patch)
treea92c16f9d0e713e20d4d1d0da5310b58e4c7a12a /youtube_dl/extractor/naver.py
parent8466336104164b37b3f32c32278e2426590db42f (diff)
[naver] Improve error regex
Diffstat (limited to 'youtube_dl/extractor/naver.py')
-rw-r--r--youtube_dl/extractor/naver.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/youtube_dl/extractor/naver.py b/youtube_dl/extractor/naver.py
index 925967753..35cbb3e6d 100644
--- a/youtube_dl/extractor/naver.py
+++ b/youtube_dl/extractor/naver.py
@@ -46,11 +46,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|nation_box)">\s*(?:<!--.*?-->)?\s*<p class="[^"]+">(?P<msg>.+?)</p>\s*</div>',
- webpage)
- if m_error:
- raise ExtractorError(clean_html(m_error.group('msg')), expected=True)
+ error = self._html_search_regex(
+ r'(?s)<div class="(?:nation_error|nation_box|error_box)">\s*(?:<!--.*?-->)?\s*<p class="[^"]+">(?P<msg>.+?)</p>\s*</div>',
+ webpage, 'error', default=None)
+ if error:
+ raise ExtractorError(error, expected=True)
raise ExtractorError('couldn\'t extract vid and key')
vid = m_id.group(1)
key = m_id.group(2)