3 from .wrestleuniverse
import WrestleUniverseBaseIE
11 class StacommuBaseIE(WrestleUniverseBaseIE
):
12 _NETRC_MACHINE
= 'stacommu'
13 _API_HOST
= 'api.stacommu.jp'
14 _LOGIN_QUERY
= {'key': 'AIzaSyCR9czxhH2eWuijEhTNWBZ5MCcOYEUTAhg'}
17 'Content-Type': 'application/json',
18 'X-Client-Version': 'Chrome/JsCore/9.9.4/FirebaseCore-web',
19 'Referer': 'https://www.stacommu.jp/',
20 'Origin': 'https://www.stacommu.jp',
23 @WrestleUniverseBaseIE._TOKEN
.getter
25 if self
._REAL
_TOKEN
and self
._TOKEN
_EXPIRY
<= int(time
.time()):
28 return self
._REAL
_TOKEN
30 def _get_formats(self
, data
, path
, video_id
=None):
31 if not traverse_obj(data
, path
) and not data
.get('canWatch') and not self
._TOKEN
:
32 self
.raise_login_required(method
='password')
33 return super()._get
_formats
(data
, path
, video_id
)
35 def _extract_hls_key(self
, data
, path
, decrypt
):
36 encryption_data
= traverse_obj(data
, path
)
37 if traverse_obj(encryption_data
, ('encryptType', {int}
)) == 0:
39 return traverse_obj(encryption_data
, {'key': ('key', {decrypt}
), 'iv': ('iv', {decrypt}
)})
41 def _extract_vod(self
, url
):
42 video_id
= self
._match
_id
(url
)
43 video_info
= self
._download
_metadata
(
44 url
, video_id
, 'ja', ('dehydratedState', 'queries', 0, 'state', 'data'))
45 hls_info
, decrypt
= self
._call
_encrypted
_api
(
46 video_id
, ':watch', 'stream information', data
={'method': 1})
50 'formats': self
._get
_formats
(hls_info
, ('protocolHls', 'url', {url_or_none}
), video_id
),
51 'hls_aes': self
._extract
_hls
_key
(hls_info
, 'protocolHls', decrypt
),
52 **traverse_obj(video_info
, {
53 'title': ('displayName', {str}
),
54 'description': ('description', {str}
),
55 'timestamp': ('watchStartTime', {int_or_none}
),
56 'thumbnail': ('keyVisualUrl', {url_or_none}
),
57 'cast': ('casts', ..., 'displayName', {str}
),
58 'duration': ('duration', {int}
),
62 def _extract_ppv(self
, url
):
63 video_id
= self
._match
_id
(url
)
64 video_info
= self
._call
_api
(video_id
, msg
='video information', query
={'al': 'ja'}, auth
=False)
65 hls_info
, decrypt
= self
._call
_encrypted
_api
(
66 video_id
, ':watchArchive', 'stream information', data
={'method': 1})
70 'formats': self
._get
_formats
(hls_info
, ('hls', 'urls', ..., {url_or_none}
), video_id
),
71 'hls_aes': self
._extract
_hls
_key
(hls_info
, 'hls', decrypt
),
72 **traverse_obj(video_info
, {
73 'title': ('displayName', {str}
),
74 'timestamp': ('startTime', {int_or_none}
),
75 'thumbnail': ('keyVisualUrl', {url_or_none}
),
76 'duration': ('duration', {int_or_none}
),
81 class StacommuVODIE(StacommuBaseIE
):
82 _VALID_URL
= r
'https?://www\.stacommu\.jp/(?:en/)?videos/episodes/(?P<id>[\da-zA-Z]+)'
85 'url': 'https://www.stacommu.jp/videos/episodes/aXcVKjHyAENEjard61soZZ',
87 'id': 'aXcVKjHyAENEjard61soZZ',
89 'title': 'スタコミュAWARDの裏側、ほぼ全部見せます!〜晴れ舞台の直前ドキドキ編〜',
90 'description': 'md5:6400275c57ae75c06da36b06f96beb1c',
91 'timestamp': 1679652000,
92 'upload_date': '20230324',
93 'thumbnail': 'https://image.stacommu.jp/6eLobQan8PFtBoU4RL4uGg/6eLobQan8PFtBoU4RL4uGg',
98 'skip_download': 'm3u8',
101 # encrypted; requires a premium account
102 'url': 'https://www.stacommu.jp/videos/episodes/3hybMByUvzMEqndSeu5LpD',
104 'id': '3hybMByUvzMEqndSeu5LpD',
106 'title': 'スタプラフェス2023〜裏側ほぼ全部見せます〜#10',
107 'description': 'md5:85494488ccf1dfa1934accdeadd7b340',
108 'timestamp': 1682506800,
109 'upload_date': '20230426',
110 'thumbnail': 'https://image.stacommu.jp/eMdXtEefR4kEyJJMpAFi7x/eMdXtEefR4kEyJJMpAFi7x',
114 'key': '6bbaf241b8e1fd9f59ecf546a70e4ae7',
115 'iv': '1fc9002a23166c3bb1d240b953d09de9',
119 'skip_download': 'm3u8',
122 'url': 'https://www.stacommu.jp/en/videos/episodes/aXcVKjHyAENEjard61soZZ',
123 'only_matching': True,
126 _API_PATH
= 'videoEpisodes'
128 def _real_extract(self
, url
):
129 return self
._extract
_vod
(url
)
132 class StacommuLiveIE(StacommuBaseIE
):
133 _VALID_URL
= r
'https?://www\.stacommu\.jp/(?:en/)?live/(?P<id>[\da-zA-Z]+)'
135 'url': 'https://www.stacommu.jp/live/d2FJ3zLnndegZJCAEzGM3m',
137 'id': 'd2FJ3zLnndegZJCAEzGM3m',
139 'title': '仲村悠菜 2023/05/04',
140 'timestamp': 1683195647,
141 'upload_date': '20230504',
142 'thumbnail': 'https://image.stacommu.jp/pHGF57SPEHE2ke83FS92FN/pHGF57SPEHE2ke83FS92FN',
145 'key': 'efbb3ec0b8246f61adf1764c5a51213a',
146 'iv': '80621d19a1f19167b64cedb415b05d1c',
150 'skip_download': 'm3u8',
153 'url': 'https://www.stacommu.jp/en/live/d2FJ3zLnndegZJCAEzGM3m',
154 'only_matching': True,
159 def _real_extract(self
, url
):
160 return self
._extract
_ppv
(url
)
163 class TheaterComplexTownBaseIE(StacommuBaseIE
):
164 _NETRC_MACHINE
= 'theatercomplextown'
165 _API_HOST
= 'api.theater-complex.town'
166 _LOGIN_QUERY
= {'key': 'AIzaSyAgNCqToaIz4a062EeIrkhI_xetVfAOrfc'}
169 'Content-Type': 'application/json',
170 'X-Client-Version': 'Chrome/JsCore/9.23.0/FirebaseCore-web',
171 'Referer': 'https://www.theater-complex.town/',
172 'Origin': 'https://www.theater-complex.town',
176 class TheaterComplexTownVODIE(TheaterComplexTownBaseIE
):
177 _VALID_URL
= r
'https?://(?:www\.)?theater-complex\.town/(?:(?:en|ja)/)?videos/episodes/(?P<id>\w+)'
178 IE_NAME
= 'theatercomplextown:vod'
180 'url': 'https://www.theater-complex.town/videos/episodes/hoxqidYNoAn7bP92DN6p78',
182 'id': 'hoxqidYNoAn7bP92DN6p78',
184 'title': '演劇ドラフトグランプリ2023 劇団『恋のぼり』〜劇団名決定秘話ラジオ',
185 'description': 'md5:a7e2e9cf570379ea67fb630f345ff65d',
186 'cast': ['玉城 裕規', '石川 凌雅'],
187 'thumbnail': 'https://image.theater-complex.town/5URnXX6KCeDysuFrPkP38o/5URnXX6KCeDysuFrPkP38o',
188 'upload_date': '20231103',
189 'timestamp': 1699016400,
193 'skip_download': 'm3u8',
196 'url': 'https://www.theater-complex.town/en/videos/episodes/6QT7XYwM9dJz5Gf9VB6K5y',
197 'only_matching': True,
199 'url': 'https://www.theater-complex.town/ja/videos/episodes/hoxqidYNoAn7bP92DN6p78',
200 'only_matching': True,
203 _API_PATH
= 'videoEpisodes'
205 def _real_extract(self
, url
):
206 return self
._extract
_vod
(url
)
209 class TheaterComplexTownPPVIE(TheaterComplexTownBaseIE
):
210 _VALID_URL
= r
'https?://(?:www\.)?theater-complex\.town/(?:(?:en|ja)/)?ppv/(?P<id>\w+)'
211 IE_NAME
= 'theatercomplextown:ppv'
213 'url': 'https://www.theater-complex.town/ppv/wytW3X7khrjJBUpKuV3jen',
215 'id': 'wytW3X7khrjJBUpKuV3jen',
217 'title': 'BREAK FREE STARS 11月5日(日)12:30千秋楽公演',
218 'thumbnail': 'https://image.theater-complex.town/5GWEB31JcTUfjtgdeV5t6o/5GWEB31JcTUfjtgdeV5t6o',
219 'upload_date': '20231105',
220 'timestamp': 1699155000,
224 'skip_download': 'm3u8',
227 'url': 'https://www.theater-complex.town/en/ppv/wytW3X7khrjJBUpKuV3jen',
228 'only_matching': True,
230 'url': 'https://www.theater-complex.town/ja/ppv/qwUVmLmGEiZ3ZW6it9uGys',
231 'only_matching': True,
236 def _real_extract(self
, url
):
237 return self
._extract
_ppv
(url
)