]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/tv3.py
2 from __future__
import unicode_literals
4 from . common
import InfoExtractor
7 class TV3IE ( InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:www\.)?tv3\.co\.nz/(?P<id>[^/]+)/tabid/\d+/articleID/\d+/MCat/\d+/Default\.aspx'
10 'url' : 'http://www.tv3.co.nz/MOTORSPORT-SRS-SsangYong-Hampton-Downs-Round-3/tabid/3692/articleID/121615/MCat/2915/Default.aspx' ,
12 'id' : '4659127992001' ,
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 ,
20 'expected_warnings' : [
21 'Failed to download MPD manifest'
25 'skip_download' : True ,
28 BRIGHTCOVE_URL_TEMPLATE
= 'http://players.brightcove.net/3812193411001/default_default/index.html?videoId= %s '
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
)