mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 14:37:21 +00:00
chore: remove unnecessary smuggled data
This commit is contained in:
parent
95dffc0e75
commit
1a22cc3d3f
|
@ -37,14 +37,14 @@ class PiaLiveIE(InfoExtractor):
|
|||
},
|
||||
]
|
||||
|
||||
def handle_embed_player(self, player_tag, video_id, info_dict={}):
|
||||
def handle_embed_player(self, player_tag, info_dict={}):
|
||||
player_data_url = extract_attributes(player_tag)['src']
|
||||
|
||||
if player_data_url.startswith(PIAULIZAPortalAPIIE.BASE_URL):
|
||||
return self.url_result(
|
||||
smuggle_url(
|
||||
player_data_url,
|
||||
{'video_id': video_id, 'referer': self.PLAYER_ROOT_URL},
|
||||
{'referer': self.PLAYER_ROOT_URL},
|
||||
),
|
||||
ie=PIAULIZAPortalAPIIE.ie_key(),
|
||||
url_transparent=True,
|
||||
|
@ -77,7 +77,7 @@ def _real_extract(self, url):
|
|||
article_code = self._search_regex(r"const articleCode = '(.*?)';", webpage, 'article code')
|
||||
chat_info = self._download_json(
|
||||
f'{self.PIA_LIVE_API_URL}/perf/chat-tag-list/{program_code}/{article_code}',
|
||||
article_code, data=payload, headers={'Content-Type': content_type, 'Referer': self.PLAYER_ROOT_URL},
|
||||
program_code, data=payload, headers={'Content-Type': content_type, 'Referer': self.PLAYER_ROOT_URL},
|
||||
)['data']['chat_one_tag']
|
||||
chat_room_url = extract_attributes(chat_info)['src']
|
||||
comment_page = self._download_webpage(
|
||||
|
@ -95,7 +95,6 @@ def _real_extract(self, url):
|
|||
|
||||
return self.handle_embed_player(
|
||||
player_tag_list['data']['movie_one_tag'],
|
||||
video_id=program_code,
|
||||
info_dict={
|
||||
'id': program_code,
|
||||
'title': self._html_extract_title(webpage),
|
||||
|
|
|
@ -49,7 +49,7 @@ class PIAULIZAPortalAPIIE(InfoExtractor):
|
|||
|
||||
def _real_extract(self, url):
|
||||
url, smuggled_data = unsmuggle_url(url, {})
|
||||
tmp_video_id = smuggled_data.get('video_id') or self._search_regex(r'&name=([^&]+)', self._match_id(url), 'video id', default='unknown')
|
||||
tmp_video_id = self._search_regex(r'&name=([^&]+)', self._match_id(url), 'video id', default='unknown')
|
||||
player_data = self._download_webpage(
|
||||
url,
|
||||
tmp_video_id,
|
||||
|
@ -61,7 +61,7 @@ def _real_extract(self, url):
|
|||
r'["\'](https://vms-api\.p\.uliza\.jp/v1/prog-index\.m3u8[^"\']+)', player_data,
|
||||
'm3u8 url', default=None)
|
||||
|
||||
video_id = smuggled_data.get('video_id') or self._search_regex(r'&?ss=([\da-f]{8}-(?:[\da-f]{4}-){3}[\da-f]{12})&?', m3u8_url, 'video id', default=tmp_video_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,
|
||||
|
@ -70,7 +70,7 @@ def _real_extract(self, url):
|
|||
r'/hls/(dvr|video)/', traverse_obj(formats, (0, 'url')), 'm3u8 type', default=None)
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': smuggled_data.get('video_title') or video_id,
|
||||
'title': video_id,
|
||||
'formats': formats,
|
||||
'live_status': {
|
||||
'video': 'is_live',
|
||||
|
@ -121,7 +121,7 @@ def _real_extract(self, url):
|
|||
return self.url_result(
|
||||
smuggle_url(
|
||||
player_data_url,
|
||||
{'video_id': video_id, 'referer': 'https://ulizaportal.jp/'},
|
||||
{'referer': 'https://ulizaportal.jp/'},
|
||||
),
|
||||
ie=PIAULIZAPortalAPIIE.ie_key(),
|
||||
url_transparent=True,
|
||||
|
|
Loading…
Reference in a new issue