2 from __future__ import unicode_literals
6 from .common import InfoExtractor
9 class LocalNews8IE(InfoExtractor):
10 _VALID_URL = r'https?://(?:www\.)?localnews8\.com/(?:[^/]+/)*(?P<display_id>[^/]+)/(?P<id>[0-9]+)'
12 'url': 'http://www.localnews8.com/news/rexburg-business-turns-carbon-fiber-scraps-into-wedding-rings/35183304',
13 'md5': 'be4d48aea61aa2bde7be2ee47691ad20',
16 'display_id': 'rexburg-business-turns-carbon-fiber-scraps-into-wedding-rings',
18 'title': 'Rexburg business turns carbon fiber scraps into wedding ring',
19 'description': 'The process was first invented by Lamborghini and less than a dozen companies around the world use it.',
21 'timestamp': 1441844822,
22 'upload_date': '20150910',
27 def _real_extract(self, url):
28 mobj = re.match(self._VALID_URL, url)
29 video_id = mobj.group('id')
30 display_id = mobj.group('display_id')
32 webpage = self._download_webpage(url, display_id)
34 partner_id = self._search_regex(
35 r'partnerId\s*[:=]\s*(["\'])(?P<id>\d+)\1',
36 webpage, 'partner id', group='id')
37 kaltura_id = self._search_regex(
38 r'videoIdString\s*[:=]\s*(["\'])kaltura:(?P<id>[0-9a-z_]+)\1',
39 webpage, 'videl id', group='id')
42 '_type': 'url_transparent',
43 'url': 'kaltura:%s:%s' % (partner_id, kaltura_id),
46 'display_id': display_id,