mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-07-02 03:18:32 +00:00
[ie/asobistage] Use get_by_cuid instead of webpage
This commit is contained in:
parent
f277f1852d
commit
cbcf86aafc
@ -62,9 +62,6 @@ class AsobiStageIE(InfoExtractor):
|
|||||||
|
|
||||||
_API_HOST = 'https://asobistage-api.asobistore.jp'
|
_API_HOST = 'https://asobistage-api.asobistore.jp'
|
||||||
_HEADERS = {}
|
_HEADERS = {}
|
||||||
_EMBED_HEADERS = {
|
|
||||||
'Referer': 'https://asobistage.asobistore.jp/',
|
|
||||||
}
|
|
||||||
_is_logged_in = False
|
_is_logged_in = False
|
||||||
|
|
||||||
@functools.cached_property
|
@functools.cached_property
|
||||||
@ -185,19 +182,23 @@ def _extract_premium_lp(self, video_id, event, slug):
|
|||||||
entries = []
|
entries = []
|
||||||
for content in traverse_obj(root_content, ('contentList', ..., 'contents', ...)):
|
for content in traverse_obj(root_content, ('contentList', ..., 'contents', ...)):
|
||||||
movie_url = content.get('movieUrl')
|
movie_url = content.get('movieUrl')
|
||||||
embed_id = movie_url.rsplit('/', 1)[-1]
|
channel_id = movie_url.rsplit('/', 1)[-1]
|
||||||
webpage = self._download_webpage(
|
channel_json = self._download_json(
|
||||||
movie_url, embed_id,
|
f'https://survapi.channel.or.jp/proxy/v1/contents/{channel_id}/get_by_cuid', channel_id,
|
||||||
'Getting movie embed page', 'Failed to get movie embed page',
|
'Getting archive channel info', 'Unable to get archive channel info', fatal=False,
|
||||||
headers=self._EMBED_HEADERS)
|
headers=self._HEADERS)
|
||||||
m3u8_url = self._search_regex(r"<source src='([^']+)' ", webpage, 'player').replace('&', '&')
|
channel_data = traverse_obj(channel_json, ('ex_content', {
|
||||||
|
'm3u8_url': 'streaming_url',
|
||||||
|
'title': 'title',
|
||||||
|
'thumbnail': ('thumbnail', 'url'),
|
||||||
|
}))
|
||||||
|
|
||||||
entries.append({
|
entries.append({
|
||||||
'id': embed_id,
|
'id': channel_id,
|
||||||
'title': root_content.get('title'),
|
'title': channel_data.get('title'),
|
||||||
'formats': self._extract_m3u8_formats(m3u8_url, embed_id, fatal=False),
|
'formats': self._extract_m3u8_formats(channel_data.get('m3u8_url'), channel_id, fatal=False),
|
||||||
'is_live': False,
|
'is_live': False,
|
||||||
'thumbnail': traverse_obj(root_content, ('thumb', 'url', {url_or_none})),
|
'thumbnail': url_or_none(channel_data.get('thumbnail')),
|
||||||
})
|
})
|
||||||
|
|
||||||
if not self._is_logged_in and not entries:
|
if not self._is_logged_in and not entries:
|
||||||
|
Loading…
Reference in New Issue
Block a user