2 from __future__
import unicode_literals
4 from .brightcove
import BrightcoveNewIE
5 from ..utils
import extract_attributes
8 class BandaiChannelIE(BrightcoveNewIE
):
9 IE_NAME
= 'bandaichannel'
10 _VALID_URL
= r
'https?://(?:www\.)?b-ch\.com/titles/(?P<id>\d+/\d+)'
12 'url': 'https://www.b-ch.com/titles/514/001',
13 'md5': 'a0f2d787baa5729bed71108257f613a4',
15 'id': '6128044564001',
17 'title': 'メタルファイターMIKU 第1話',
18 'timestamp': 1580354056,
19 'uploader_id': '5797077852001',
20 'upload_date': '20200130',
24 'format': 'bestvideo',
25 'skip_download': True,
29 def _real_extract(self
, url
):
30 video_id
= self
._match
_id
(url
)
31 webpage
= self
._download
_webpage
(url
, video_id
)
32 attrs
= extract_attributes(self
._search
_regex
(
33 r
'(<video-js[^>]+\bid="bcplayer"[^>]*>)', webpage
, 'player'))
34 bc
= self
._download
_json
(
35 'https://pbifcd.b-ch.com/v1/playbackinfo/ST/70/' + attrs
['data-info'],
36 video_id
, headers
={'X-API-KEY': attrs['data-auth'].strip()}
)['bc']
37 return self
._parse
_brightcove
_metadata
(bc
, bc
['id'])