1 from .common
import InfoExtractor
11 class PIAULIZAPortalIE(InfoExtractor
):
12 IE_DESC
= 'ulizaportal.jp - PIA LIVE STREAM'
13 _VALID_URL
= r
'https?://(?:www\.)?ulizaportal\.jp/pages/(?P<id>[\da-f]{8}-(?:[\da-f]{4}-){3}[\da-f]{12})'
15 'url': 'https://ulizaportal.jp/pages/005f18b7-e810-5618-cb82-0987c5755d44',
17 'id': '005f18b7-e810-5618-cb82-0987c5755d44',
18 'title': 'プレゼンテーションプレイヤーのサンプル',
19 'live_status': 'not_live',
22 'skip_download': True,
23 'ignore_no_formats_error': True,
26 'url': 'https://ulizaportal.jp/pages/005e1b23-fe93-5780-19a0-98e917cc4b7d?expires=4102412400&signature=f422a993b683e1068f946caf406d211c17d1ef17da8bef3df4a519502155aa91&version=1',
28 'id': '005e1b23-fe93-5780-19a0-98e917cc4b7d',
29 'title': '【確認用】視聴サンプルページ(ULIZA)',
30 'live_status': 'not_live',
33 'skip_download': True,
34 'ignore_no_formats_error': True,
38 def _real_extract(self
, url
):
39 video_id
= self
._match
_id
(url
)
41 expires
= int_or_none(traverse_obj(parse_qs(url
), ('expires', 0)))
42 if expires
and expires
<= time_seconds():
43 raise ExtractorError('The link is expired.', video_id
=video_id
, expected
=True)
45 webpage
= self
._download
_webpage
(url
, video_id
)
47 player_data
= self
._download
_webpage
(
49 r
'<script [^>]*\bsrc="(https://player-api\.p\.uliza\.jp/v1/players/[^"]+)"',
50 webpage
, 'player data url'),
51 video_id
, headers
={'Referer': 'https://ulizaportal.jp/'},
52 note
='Fetching player data', errnote
='Unable to fetch player data')
54 formats
= self
._extract
_m
3u8_formats
(
56 r
'["\'](https
://vms
-api\
.p\
.uliza\
.jp
/v1
/prog
-index\
.m3u8
[^
"\']+)', player_data,
57 'm3u8 url', default=None),
58 video_id, fatal=False)
59 m3u8_type = self._search_regex(
60 r'/hls/(dvr|video)/', traverse_obj(formats, (0, 'url')), 'm3u8 type', default=None)
64 'title': self._html_extract_title(webpage),
68 'dvr': 'was_live', # short-term archives
69 }.get(m3u8_type, 'not_live'), # VOD or long-term archives