From c7a8f51d29deb98854c020e6f2ca6b2725c8f129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sun, 1 Jan 2017 04:55:17 +0100 Subject: [PATCH] [biqle] Fix extraction. Fixes #11471 --- youtube_dl/extractor/biqle.py | 8 +++++--- youtube_dl/extractor/vk.py | 19 +++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/youtube_dl/extractor/biqle.py b/youtube_dl/extractor/biqle.py index beaebfd2a..d48a2aa9b 100644 --- a/youtube_dl/extractor/biqle.py +++ b/youtube_dl/extractor/biqle.py @@ -15,24 +15,26 @@ class BIQLEIE(InfoExtractor): 'title': 'Foo Fighters - The Pretender (Live at Wembley Stadium)', 'uploader': 'Andrey Rogozin', 'upload_date': '20110605', + 'timestamp': 1307314500, } }, { - 'url': 'https://biqle.org/watch/-44781847_168547604', + 'url': 'https://biqle.ru/watch/-44781847_168547604', 'md5': '7f24e72af1db0edf7c1aaba513174f97', 'info_dict': { 'id': '168547604', 'ext': 'mp4', 'title': 'Ребенок в шоке от автоматической мойки', 'uploader': 'Dmitry Kotov', + 'upload_date': '20140404', + 'timestamp': 1396644240, }, - 'skip': ' This video was marked as adult. Embedding adult videos on external sites is prohibited.', }] def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) embed_url = self._proto_relative_url(self._search_regex( - r'', webpage, 'embed url')) + r'', webpage, 'embed url')) return { '_type': 'url_transparent', diff --git a/youtube_dl/extractor/vk.py b/youtube_dl/extractor/vk.py index 7c42a4f54..3e0c9e9f9 100644 --- a/youtube_dl/extractor/vk.py +++ b/youtube_dl/extractor/vk.py @@ -87,7 +87,7 @@ class VKIE(VKBaseIE): (?:(?:m|new)\.)?vk\.com/video_| (?:www\.)?daxab.com/ ) - ext\.php\?(?P.*?\boid=(?P-?\d+).*?\bid=(?P\d+).*)| + (?:ext\.php|player/)\?(?P.*?\boid=(?P-?\d+).*?\bid=(?P\d+).*)| (?: (?:(?:m|new)\.)?vk\.com/(?:.+?\?.*?z=)?video| (?:www\.)?daxab.com/embed/ @@ -293,16 +293,15 @@ class VKIE(VKBaseIE): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('videoid') - if video_id: - info_url = 'https://vk.com/al_video.php?act=show&al=1&module=video&video=%s' % video_id - # Some videos (removed?) can only be downloaded with list id specified - list_id = mobj.group('list_id') - if list_id: - info_url += '&list=%s' % list_id - else: - info_url = 'http://vk.com/video_ext.php?' + mobj.group('embed_query') + if not video_id: video_id = '%s_%s' % (mobj.group('oid'), mobj.group('id')) + info_url = 'https://vk.com/al_video.php?act=show&al=1&module=video&video=%s' % video_id + # Some videos (removed?) can only be downloaded with list id specified + list_id = mobj.group('list_id') + if list_id: + info_url += '&list=%s' % list_id + info_page = self._download_webpage(info_url, video_id) error_message = self._html_search_regex( @@ -389,7 +388,7 @@ class VKIE(VKBaseIE): if not data: data = self._parse_json( self._search_regex( - r'\s*({.+?})\s*', info_page, 'json', default='{}'), + r'({(?:(?!).)*})(?:|$)', info_page, 'json', default='{}'), video_id) if data: data = data['player']['params'][0]