mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[ok] Capture error message
This commit is contained in:
parent
659ffe204c
commit
1806a75415
1 changed files with 7 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import compat_urllib_parse_unquote
|
from ..compat import compat_urllib_parse_unquote
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
ExtractorError,
|
||||||
unified_strdate,
|
unified_strdate,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
qualities,
|
qualities,
|
||||||
|
@ -72,6 +73,12 @@ def _real_extract(self, url):
|
||||||
webpage = self._download_webpage(
|
webpage = self._download_webpage(
|
||||||
'http://ok.ru/video/%s' % video_id, video_id)
|
'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(
|
player = self._parse_json(
|
||||||
unescapeHTML(self._search_regex(
|
unescapeHTML(self._search_regex(
|
||||||
r'data-options=(?P<quote>["\'])(?P<player>{.+?%s.+?})(?P=quote)' % video_id,
|
r'data-options=(?P<quote>["\'])(?P<player>{.+?%s.+?})(?P=quote)' % video_id,
|
||||||
|
|
Loading…
Reference in a new issue