]>
Commit | Line | Data |
---|---|---|
6756602b T |
1 | from .common import InfoExtractor |
2 | ||
3 | ||
4 | class LocalNews8IE(InfoExtractor): | |
1846e9ad | 5 | _VALID_URL = r'https?://(?:www\.)?localnews8\.com/(?:[^/]+/)*(?P<display_id>[^/]+)/(?P<id>[0-9]+)' |
6756602b T |
6 | _TEST = { |
7 | 'url': 'http://www.localnews8.com/news/rexburg-business-turns-carbon-fiber-scraps-into-wedding-rings/35183304', | |
1846e9ad | 8 | 'md5': 'be4d48aea61aa2bde7be2ee47691ad20', |
6756602b T |
9 | 'info_dict': { |
10 | 'id': '35183304', | |
1846e9ad | 11 | 'display_id': 'rexburg-business-turns-carbon-fiber-scraps-into-wedding-rings', |
6756602b T |
12 | 'ext': 'mp4', |
13 | 'title': 'Rexburg business turns carbon fiber scraps into wedding ring', | |
14 | 'description': 'The process was first invented by Lamborghini and less than a dozen companies around the world use it.', | |
1846e9ad S |
15 | 'duration': 153, |
16 | 'timestamp': 1441844822, | |
17 | 'upload_date': '20150910', | |
6756602b | 18 | 'uploader_id': 'api', |
1846e9ad S |
19 | } |
20 | } | |
6756602b T |
21 | |
22 | def _real_extract(self, url): | |
5ad28e7f | 23 | mobj = self._match_valid_url(url) |
1846e9ad S |
24 | video_id = mobj.group('id') |
25 | display_id = mobj.group('display_id') | |
26 | ||
27 | webpage = self._download_webpage(url, display_id) | |
6756602b | 28 | |
1846e9ad S |
29 | partner_id = self._search_regex( |
30 | r'partnerId\s*[:=]\s*(["\'])(?P<id>\d+)\1', | |
31 | webpage, 'partner id', group='id') | |
32 | kaltura_id = self._search_regex( | |
33 | r'videoIdString\s*[:=]\s*(["\'])kaltura:(?P<id>[0-9a-z_]+)\1', | |
34 | webpage, 'videl id', group='id') | |
6756602b | 35 | |
1846e9ad S |
36 | return { |
37 | '_type': 'url_transparent', | |
38 | 'url': 'kaltura:%s:%s' % (partner_id, kaltura_id), | |
39 | 'ie_key': 'Kaltura', | |
40 | 'id': video_id, | |
41 | 'display_id': display_id, | |
42 | } |