Support skipping "initial_data" request to reduce the number of requests by setting the player_skip parameter, for advanced options that only need to obtain the downloadable format (will result in loss of metadata such as uploader, description, view_count, comment_count, etc.)

This commit is contained in:
lhc 2025-04-08 15:15:54 +08:00
parent 74e90dd9b8
commit bbf9df99f5

View File

@ -3874,7 +3874,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
if not traverse_obj(initial_data, 'contents'):
self.report_warning('Incomplete data received in embedded initial data; re-fetching using API.')
initial_data = None
if not initial_data:
if not initial_data and 'initial_data' not in self._configuration_arg('player_skip'):
query = {'videoId': video_id}
query.update(self._get_checkok_params())
initial_data = self._extract_response(