projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c451d4f
)
[naver] Capture and output error message (#4057)
author
Sergey M․
<dstftw@gmail.com>
Wed, 29 Oct 2014 14:50:37 +0000
(21:50 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Wed, 29 Oct 2014 14:50:37 +0000
(21:50 +0700)
youtube_dl/extractor/naver.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/naver.py
b/youtube_dl/extractor/naver.py
index c0231c197b12b86c669e9cff4b34a5c2ac1639bf..cb1af9ecc134a8b8487dd53a32da357e44240ea9 100644
(file)
--- a/
youtube_dl/extractor/naver.py
+++ b/
youtube_dl/extractor/naver.py
@@
-7,6
+7,7
@@
from .common import InfoExtractor
from ..utils import (
compat_urllib_parse,
ExtractorError,
from ..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_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)
raise ExtractorError('couldn\'t extract vid and key')
vid = m_id.group(1)
key = m_id.group(2)