From 1a22cc3d3f1819f2ff14438646e36f2c055815e1 Mon Sep 17 00:00:00 2001 From: ChocoLZS Date: Fri, 23 Aug 2024 10:01:07 +0800 Subject: [PATCH] chore: remove unnecessary smuggled data --- yt_dlp/extractor/pialive.py | 7 +++---- yt_dlp/extractor/piaulizaportal.py | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/yt_dlp/extractor/pialive.py b/yt_dlp/extractor/pialive.py index 80fb572fd8..77f05b2006 100644 --- a/yt_dlp/extractor/pialive.py +++ b/yt_dlp/extractor/pialive.py @@ -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 @@ class PiaLiveIE(InfoExtractor): 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 @@ class PiaLiveIE(InfoExtractor): 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), diff --git a/yt_dlp/extractor/piaulizaportal.py b/yt_dlp/extractor/piaulizaportal.py index 4ce72b5ca2..62b8463e8d 100644 --- a/yt_dlp/extractor/piaulizaportal.py +++ b/yt_dlp/extractor/piaulizaportal.py @@ -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 @@ class PIAULIZAPortalAPIIE(InfoExtractor): 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 @@ class PIAULIZAPortalAPIIE(InfoExtractor): 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 @@ class PIAULIZAPortalIE(InfoExtractor): 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,