summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSergey M․ <[email protected]>2015-09-17 22:59:15 +0600
committerSergey M․ <[email protected]>2015-09-17 22:59:15 +0600
commit1806a75415a3b62b07ab3fd282f915c6af14dfd3 (patch)
treea686a632ddfc3eef7047c32e4b0a06c7c78a3b4a
parent659ffe204c946b977266aa373110fe50a2763066 (diff)
downloadyoutube-dl-1806a75415a3b62b07ab3fd282f915c6af14dfd3.tar.gz
youtube-dl-1806a75415a3b62b07ab3fd282f915c6af14dfd3.zip
[ok] Capture error message
-rw-r--r--youtube_dl/extractor/odnoklassniki.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube_dl/extractor/odnoklassniki.py b/youtube_dl/extractor/odnoklassniki.py
index 66520c2c5..0cd96c10a 100644
--- a/youtube_dl/extractor/odnoklassniki.py
+++ b/youtube_dl/extractor/odnoklassniki.py
@@ -4,6 +4,7 @@ from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
+ ExtractorError,
unified_strdate,
int_or_none,
qualities,
@@ -72,6 +73,12 @@ class OdnoklassnikiIE(InfoExtractor):
webpage = self._download_webpage(
'http://ok.ru/video/%s' % video_id, video_id)
+ error = self._search_regex(
+ r'[^>]+class="vp_video_stub_txt"[^>]*>([^<]+)<',
+ webpage, 'error', default=None)
+ if error:
+ raise ExtractorError(error, expected=True)
+
player = self._parse_json(
unescapeHTML(self._search_regex(
r'data-options=(?P<quote>["\'])(?P<player>{.+?%s.+?})(?P=quote)' % video_id,