]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/tenplay.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
12 class TenPlayIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www\.)?10play\.com\.au/(?:[^/]+/)+(?P<id>tpv\d{6}[a-z]{5})'
15 'url': 'https://10play.com.au/masterchef/episodes/season-1/masterchef-s1-ep-1/tpv190718kwzga',
17 'id': '6060533435001',
19 'title': 'MasterChef - S1 Ep. 1',
20 'description': 'md5:4fe7b78e28af8f2d900cd20d900ef95c',
22 'timestamp': 1240828200,
23 'upload_date': '20090427',
24 'uploader_id': '2199827728001',
27 'format': 'bestvideo',
28 'skip_download': True,
31 'url': 'https://10play.com.au/how-to-stay-married/web-extras/season-1/terrys-talks-ep-1-embracing-change/tpv190915ylupc',
32 'only_matching': True,
34 BRIGHTCOVE_URL_TEMPLATE
= 'https://players.brightcove.net/2199827728001/cN6vRtRQt_default/index.html?videoId=%s'
36 def _real_extract(self
, url
):
37 content_id
= self
._match
_id
(url
)
38 data
= self
._download
_json
(
39 'https://10play.com.au/api/video/' + content_id
, content_id
)
40 video
= data
.get('video') or {}
41 metadata
= data
.get('metaData') or {}
42 brightcove_id
= video
.get('videoId') or metadata
['showContentVideoId']
43 brightcove_url
= smuggle_url(
44 self
.BRIGHTCOVE_URL_TEMPLATE
% brightcove_id
,
45 {'geo_countries': ['AU']})
48 '_type': 'url_transparent',
49 'url': brightcove_url
,
51 'title': video
.get('title') or metadata
.get('pageContentName') or metadata
.get('showContentName'),
52 'description': video
.get('description'),
53 'age_limit': parse_age_limit(video
.get('showRatingClassification') or metadata
.get('showProgramClassification')),
54 'series': metadata
.get('showName'),
55 'season': metadata
.get('showContentSeason'),
56 'timestamp': parse_iso8601(metadata
.get('contentPublishDate') or metadata
.get('pageContentPublishDate')),
57 'ie_key': 'BrightcoveNew',