]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/tv3.py
3867ec90d016e84dcc717c9009cd12f190369364
[youtubedl] / youtube_dl / extractor / tv3.py
1 # coding: utf-8
2 from __future__ import unicode_literals
3
4 from .common import InfoExtractor
5
6
7 class TV3IE(InfoExtractor):
8 _VALID_URL = r'https?://(?:www\.)?tv3\.co\.nz/(?P<id>[^/]+)/tabid/\d+/articleID/\d+/MCat/\d+/Default\.aspx'
9 _TEST = {
10 'url': 'http://www.tv3.co.nz/MOTORSPORT-SRS-SsangYong-Hampton-Downs-Round-3/tabid/3692/articleID/121615/MCat/2915/Default.aspx',
11 'info_dict': {
12 'id': '4659127992001',
13 'ext': 'mp4',
14 'title': 'CRC Motorsport: SRS SsangYong Hampton Downs Round 3 - S2015 Ep3',
15 'description': 'SsangYong Racing Series returns for Round 3 with drivers from New Zealand and Australia taking to the grid at Hampton Downs raceway.',
16 'uploader_id': '3812193411001',
17 'upload_date': '20151213',
18 'timestamp': 1449975272,
19 },
20 'expected_warnings': [
21 'Failed to download MPD manifest'
22 ],
23 'params': {
24 # m3u8 download
25 'skip_download': True,
26 },
27 }
28 BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/3812193411001/default_default/index.html?videoId=%s'
29
30 def _real_extract(self, url):
31 display_id = self._match_id(url)
32 webpage = self._download_webpage(url, display_id)
33 brightcove_id = self._search_regex(r'<param\s*name="@videoPlayer"\s*value="(\d+)"', webpage, 'brightcove id')
34 return self.url_result(self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id, 'BrightcoveNew', brightcove_id)