projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb6444e
)
[playvid] Capture and output error message
author
Sergey M․
<dstftw@gmail.com>
Sat, 29 Nov 2014 16:16:35 +0000
(22:16 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 29 Nov 2014 16:16:35 +0000
(22:16 +0600)
youtube_dl/extractor/playvid.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/playvid.py
b/youtube_dl/extractor/playvid.py
index b1322f13f8b62a4618b1f857dadf0829b9752238..cd3905acb0fcd0ef9fe08beec2bda41fd2f94f70 100644
(file)
--- a/
youtube_dl/extractor/playvid.py
+++ b/
youtube_dl/extractor/playvid.py
@@
-4,6
+4,8
@@
import re
from .common import InfoExtractor
from ..utils import (
+ ExtractorError,
+ clean_html,
compat_urllib_parse,
)
@@
-28,6
+30,11
@@
class PlayvidIE(InfoExtractor):
webpage = self._download_webpage(url, video_id)
+ m_error = re.search(
+ r'<div class="block-error">\s*<div class="heading">\s*<div>(?P<msg>.+?)</div>\s*</div>', webpage)
+ if m_error:
+ raise ExtractorError(clean_html(m_error.group('msg')), expected=True)
+
video_title = None
duration = None
video_thumbnail = None