2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
12 class NTVCoJpCUIE(InfoExtractor
):
13 IE_NAME
= 'cu.ntv.co.jp'
14 IE_DESC
= 'Nippon Television Network'
15 _VALID_URL
= r
'https?://cu\.ntv\.co\.jp/(?!program)(?P<id>[^/?&#]+)'
17 'url': 'https://cu.ntv.co.jp/televiva-chill-gohan_181031/',
19 'id': '5978891207001',
21 'title': '桜エビと炒り卵がポイント! 「中華風 エビチリおにぎり」──『美虎』五十嵐美幸',
22 'upload_date': '20181213',
23 'description': 'md5:1985b51a9abc285df0104d982a325f2a',
24 'uploader_id': '3855502814001',
25 'timestamp': 1544669941,
29 'skip_download': True,
33 BRIGHTCOVE_URL_TEMPLATE
= 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s'
35 def _real_extract(self
, url
):
36 display_id
= self
._match
_id
(url
)
37 webpage
= self
._download
_webpage
(url
, display_id
)
38 player_config
= self
._search
_nuxt
_data
(webpage
, display_id
)
39 video_id
= traverse_obj(player_config
, ('movie', 'video_id'))
41 raise ExtractorError('Failed to extract video ID for Brightcove')
42 account_id
= traverse_obj(player_config
, ('player', 'account')) or '3855502814001'
43 title
= traverse_obj(player_config
, ('movie', 'name'))
45 og_title
= self
._og
_search
_title
(webpage
, fatal
=False) or traverse_obj(player_config
, ('player', 'title'))
47 title
= og_title
.split('(', 1)[0].strip()
48 description
= (traverse_obj(player_config
, ('movie', 'description'))
49 or self
._html
_search
_meta
(['description', 'og:description'], webpage
))
51 '_type': 'url_transparent',
53 'display_id': display_id
,
55 'description': description
,
56 'url': smuggle_url(self
.BRIGHTCOVE_URL_TEMPLATE
% (account_id
, video_id
), {'geo_countries': ['JP']}
),
57 'ie_key': 'BrightcoveNew',