]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/ntvcojp.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
11 class NTVCoJpCUIE(InfoExtractor
):
12 IE_NAME
= 'cu.ntv.co.jp'
13 IE_DESC
= 'Nippon Television Network'
14 _VALID_URL
= r
'https?://cu\.ntv\.co\.jp/(?!program)(?P<id>[^/?&#]+)'
16 'url': 'https://cu.ntv.co.jp/televiva-chill-gohan_181031/',
18 'id': '5978891207001',
20 'title': '桜エビと炒り卵がポイント! 「中華風 エビチリおにぎり」──『美虎』五十嵐美幸',
21 'upload_date': '20181213',
22 'description': 'md5:211b52f4fd60f3e0e72b68b0c6ba52a9',
23 'uploader_id': '3855502814001',
24 'timestamp': 1544669941,
28 'skip_download': True,
31 BRIGHTCOVE_URL_TEMPLATE
= 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s'
33 def _real_extract(self
, url
):
34 display_id
= self
._match
_id
(url
)
35 webpage
= self
._download
_webpage
(url
, display_id
)
36 player_config
= self
._parse
_json
(self
._search
_regex
(
37 r
'(?s)PLAYER_CONFIG\s*=\s*({.+?})',
38 webpage
, 'player config'), display_id
, js_to_json
)
39 video_id
= player_config
['videoId']
40 account_id
= player_config
.get('account') or '3855502814001'
42 '_type': 'url_transparent',
44 'display_id': display_id
,
45 'title': self
._search
_regex
(r
'<h1[^>]+class="title"[^>]*>([^<]+)', webpage
, 'title').strip(),
46 'description': self
._html
_search
_meta
(['description', 'og:description'], webpage
),
47 'url': smuggle_url(self
.BRIGHTCOVE_URL_TEMPLATE
% (account_id
, video_id
), {'geo_countries': ['JP']}),
48 'ie_key': 'BrightcoveNew',