From 366b759a60d0875ebd322e1cdf389a589ac23c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Mon, 9 Jan 2017 23:08:59 +0700 Subject: [PATCH] [inc] Improve (closes #11647) --- youtube_dl/extractor/inc.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/youtube_dl/extractor/inc.py b/youtube_dl/extractor/inc.py index 279e53c154..241ec83c4e 100644 --- a/youtube_dl/extractor/inc.py +++ b/youtube_dl/extractor/inc.py @@ -1,10 +1,11 @@ from __future__ import unicode_literals from .common import InfoExtractor +from .kaltura import KalturaIE class IncIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?inc\.com(?:/[\w-]+)+/(?P[\w-]+)(?:\.html)?' + _VALID_URL = r'https?://(?:www\.)?inc\.com/(?:[^/]+/)+(?P[^.]+).html' _TESTS = [{ 'url': 'http://www.inc.com/tip-sheet/bill-gates-says-these-5-books-will-make-you-smarter.html', 'md5': '7416739c9c16438c09fa35619d6ba5cb', @@ -17,6 +18,9 @@ class IncIE(InfoExtractor): 'upload_date': '20160920', 'uploader_id': 'video@inc.com', }, + 'params': { + 'skip_download': True, + }, }, { 'url': 'http://www.inc.com/video/david-whitford/founders-forum-tripadvisor-steve-kaufer-most-enjoyable-moment-for-entrepreneur.html', 'only_matching': True, @@ -27,14 +31,11 @@ def _real_extract(self, url): webpage = self._download_webpage(url, display_id) partner_id = self._search_regex( - r'var\s+_bizo_data_partner_id\s*=\s*"(\d+)";', - webpage, - 'partner id') + r'var\s+_?bizo_data_partner_id\s*=\s*["\'](\d+)', webpage, 'partner id') kaltura_id = self._parse_json(self._search_regex( - r'pageInfo\.videos\s*=\s*\[(.+)\];', - webpage, - 'kaltura id'), + r'pageInfo\.videos\s*=\s*\[(.+)\];', webpage, 'kaltura id'), display_id)['vid_kaltura_id'] - return self.url_result('kaltura:%s:%s' % (partner_id, kaltura_id), 'Kaltura') + return self.url_result( + 'kaltura:%s:%s' % (partner_id, kaltura_id), KalturaIE.ie_key())