mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-07 09:23:38 +00:00
fix: error
This commit is contained in:
parent
aa410c803b
commit
7b94a0000c
@ -6,6 +6,7 @@ from ..utils.traversal import traverse_obj
|
||||
class PiaLiveIE(InfoExtractor):
|
||||
PLAYER_ROOT_URL = 'https://player.pia-live.jp/'
|
||||
PIA_LIVE_API_URL = 'https://api.pia-live.jp'
|
||||
API_KEY = 'kfds)FKFps-dms9e'
|
||||
_VALID_URL = r'https?://player\.pia-live\.jp/stream/(?P<id>[\w-]+)'
|
||||
|
||||
_TESTS = [
|
||||
@ -55,18 +56,18 @@ class PiaLiveIE(InfoExtractor):
|
||||
|
||||
payload, content_type = multipart_encode({
|
||||
'play_url': video_key,
|
||||
'api_key': self._extract_vars('APIKEY', prod_configure)})
|
||||
'api_key': self.API_KEY})
|
||||
|
||||
player_tag_list = self._download_json(
|
||||
f'{self.PIA_LIVE_API_URL}/perf/player-tag-list/{program_code}', program_code,
|
||||
data=payload, headers={'Content-Type': content_type, 'Referer': self.PLAYER_ROOT_URL},
|
||||
note='Fetching player tag list', errnote='Unable to fetch player tag list')
|
||||
|
||||
chat_room_url = traverse_obj(self._download_json(
|
||||
f'{self.PIA_LIVE_API_URL}/perf/chat-tag-list/{program_code}/{article_code}', program_code,
|
||||
data=payload, headers={'Content-Type': content_type, 'Referer': self.PLAYER_ROOT_URL},
|
||||
note='Fetching chat info', errnote='Unable to fetch chat info', fatal=False),
|
||||
('data', 'chat_one_tag', {extract_attributes}, 'src', {url_or_none}))
|
||||
if self.get_param('getcomments'):
|
||||
chat_room_url = traverse_obj(self._download_json(
|
||||
f'{self.PIA_LIVE_API_URL}/perf/chat-tag-list/{program_code}/{article_code}', program_code,
|
||||
data=payload, headers={'Content-Type': content_type, 'Referer': self.PLAYER_ROOT_URL},
|
||||
note='Fetching chat info', errnote='Unable to fetch chat info', fatal=False),
|
||||
('data', 'chat_one_tag', {extract_attributes}, 'src', {url_or_none}))
|
||||
|
||||
return self.url_result(
|
||||
extract_attributes(player_tag_list['data']['movie_one_tag'])['src'], url_transparent=True,
|
||||
|
||||
@ -43,19 +43,16 @@ class PIAULIZAPortalAPIIE(InfoExtractor):
|
||||
def _real_extract(self, url):
|
||||
display_id = self._match_id(url)
|
||||
player_data = self._download_webpage(
|
||||
url, tmp_video_id, headers={'Referer': 'https://player-api.p.uliza.jp/'},
|
||||
url, display_id, headers={'Referer': 'https://player-api.p.uliza.jp/'},
|
||||
note='Fetching player data', errnote='Unable to fetch player data',
|
||||
)
|
||||
|
||||
player_data = self._search_json(
|
||||
r'var\s+params\s*=', player_js, 'json', display_id,
|
||||
transform_source=js_to_json)
|
||||
m3u8_url = self._search_regex(
|
||||
r'["\'](https://vms-api\.p\.uliza\.jp/v1/prog-index\.m3u8[^"\']+)', player_data,
|
||||
'm3u8 url', default=None)
|
||||
video_id = self._search_regex(r'&?ss=([\da-f]{8}-(?:[\da-f]{4}-){3}[\da-f]{12})&?', m3u8_url, 'video id', default=display_id)
|
||||
|
||||
video_id = self._search_regex(r'&?ss=([\da-f]{8}-(?:[\da-f]{4}-){3}[\da-f]{12})&?', m3u8_url, 'video id', default=tmp_video_id)
|
||||
|
||||
formats = self._extract_m3u8_formats(
|
||||
m3u8_url,
|
||||
video_id, fatal=False)
|
||||
formats = self._extract_m3u8_formats(m3u8_url, video_id)
|
||||
m3u8_type = self._search_regex(
|
||||
r'/hls/(dvr|video)/', traverse_obj(formats, (0, 'url')), 'm3u8 type', default=None)
|
||||
return {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user