diff options
author | Sergey M․ <dstftw@gmail.com> | 2019-09-28 00:04:52 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2019-09-28 00:04:52 +0700 |
commit | 6483fbd336839c45a376d08d8f4a34e97d581e5e (patch) | |
tree | 6595bde4d9212eb8a1f4946fe5dc53b0eb6019fe /youtube_dl | |
parent | 8130ac42e500643e03faaae512166fe71387473d (diff) |
[vk] Fix extraction (closes #22522)
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/vk.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/youtube_dl/extractor/vk.py b/youtube_dl/extractor/vk.py index f57ed2288..8b6dc0e24 100644 --- a/youtube_dl/extractor/vk.py +++ b/youtube_dl/extractor/vk.py @@ -403,8 +403,17 @@ class VKIE(VKBaseIE): data = self._parse_json( self._search_regex( r'var\s+playerParams\s*=\s*({.+?})\s*;\s*\n', info_page, - 'player params'), - video_id)['params'][0] + 'player params', default='{}'), + video_id) + if data: + data = data['params'][0] + + # <!--{...} + if not data: + data = self._parse_json( + self._search_regex( + r'<!--\s*({.+})', info_page, 'payload'), + video_id)['payload'][-1][-1]['player']['params'][0] title = unescapeHTML(data['md_title']) |