mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-07-18 03:08:31 +00:00
Merge e9e9384880
into c1ac543c81
This commit is contained in:
commit
3c753464b5
@ -261,9 +261,8 @@ class SubsPoTokenPolicy(BasePoTokenPolicy):
|
|||||||
not_required_with_player_token=True,
|
not_required_with_player_token=True,
|
||||||
),
|
),
|
||||||
# HLS Livestreams require POT 30 seconds in
|
# HLS Livestreams require POT 30 seconds in
|
||||||
# TODO: Rolling out
|
|
||||||
StreamingProtocol.HLS: GvsPoTokenPolicy(
|
StreamingProtocol.HLS: GvsPoTokenPolicy(
|
||||||
required=False,
|
required=True,
|
||||||
recommended=True,
|
recommended=True,
|
||||||
not_required_with_player_token=True,
|
not_required_with_player_token=True,
|
||||||
),
|
),
|
||||||
|
@ -256,7 +256,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||||||
'401': {'ext': 'mp4', 'height': 2160, 'format_note': 'DASH video', 'vcodec': 'av01.0.12M.08'},
|
'401': {'ext': 'mp4', 'height': 2160, 'format_note': 'DASH video', 'vcodec': 'av01.0.12M.08'},
|
||||||
}
|
}
|
||||||
_SUBTITLE_FORMATS = ('json3', 'srv1', 'srv2', 'srv3', 'ttml', 'srt', 'vtt')
|
_SUBTITLE_FORMATS = ('json3', 'srv1', 'srv2', 'srv3', 'ttml', 'srt', 'vtt')
|
||||||
_DEFAULT_CLIENTS = ('tv', 'ios', 'web')
|
_DEFAULT_CLIENTS = ('tv', 'web')
|
||||||
_DEFAULT_AUTHED_CLIENTS = ('tv', 'web')
|
_DEFAULT_AUTHED_CLIENTS = ('tv', 'web')
|
||||||
# Premium does not require POT (except for subtitles)
|
# Premium does not require POT (except for subtitles)
|
||||||
_DEFAULT_PREMIUM_CLIENTS = ('tv', 'web')
|
_DEFAULT_PREMIUM_CLIENTS = ('tv', 'web')
|
||||||
@ -3291,11 +3291,9 @@ def _report_pot_format_skipped(self, video_id, client_name, proto):
|
|||||||
f'{video_id}: {client_name} client {proto} formats require a GVS PO Token which was not provided. '
|
f'{video_id}: {client_name} client {proto} formats require a GVS PO Token which was not provided. '
|
||||||
'They will be skipped as they may yield HTTP Error 403. '
|
'They will be skipped as they may yield HTTP Error 403. '
|
||||||
f'You can manually pass a GVS PO Token for this client with --extractor-args "youtube:po_token={client_name}.gvs+XXX". '
|
f'You can manually pass a GVS PO Token for this client with --extractor-args "youtube:po_token={client_name}.gvs+XXX". '
|
||||||
f'For more information, refer to {PO_TOKEN_GUIDE_URL} . '
|
f'For more information, refer to {PO_TOKEN_GUIDE_URL} . ')
|
||||||
'To enable these broken formats anyway, pass --extractor-args "youtube:formats=missing_pot"')
|
|
||||||
|
|
||||||
# Only raise a warning for non-default clients, to not confuse users.
|
# Only raise a warning for non-default clients, to not confuse users.
|
||||||
# iOS HLS formats still work without PO Token, so we don't need to warn about them.
|
|
||||||
if client_name in (*self._DEFAULT_CLIENTS, *self._DEFAULT_AUTHED_CLIENTS):
|
if client_name in (*self._DEFAULT_CLIENTS, *self._DEFAULT_AUTHED_CLIENTS):
|
||||||
self.write_debug(msg, only_once=True)
|
self.write_debug(msg, only_once=True)
|
||||||
else:
|
else:
|
||||||
@ -3584,11 +3582,6 @@ def process_manifest_format(f, proto, client_name, itag, missing_pot):
|
|||||||
f['format_note'] = join_nonempty(f.get('format_note'), 'MISSING POT', delim=' ')
|
f['format_note'] = join_nonempty(f.get('format_note'), 'MISSING POT', delim=' ')
|
||||||
f['source_preference'] -= 20
|
f['source_preference'] -= 20
|
||||||
|
|
||||||
# XXX: Check if IOS HLS formats are affected by PO token enforcement; temporary
|
|
||||||
# See https://github.com/yt-dlp/yt-dlp/issues/13511
|
|
||||||
if proto == 'hls' and client_name == 'ios':
|
|
||||||
f['__needs_testing'] = True
|
|
||||||
|
|
||||||
itags[itag].add(key)
|
itags[itag].add(key)
|
||||||
|
|
||||||
if itag and all_formats:
|
if itag and all_formats:
|
||||||
@ -4373,7 +4366,6 @@ def process_language(container, base_url, lang_code, sub_name, client_name, quer
|
|||||||
|
|
||||||
if upload_date and live_status not in ('is_live', 'post_live', 'is_upcoming'):
|
if upload_date and live_status not in ('is_live', 'post_live', 'is_upcoming'):
|
||||||
# Newly uploaded videos' HLS formats are potentially problematic and need to be checked
|
# Newly uploaded videos' HLS formats are potentially problematic and need to be checked
|
||||||
# XXX: This is redundant for as long as we are already checking all IOS HLS formats
|
|
||||||
upload_datetime = datetime_from_str(upload_date).replace(tzinfo=dt.timezone.utc)
|
upload_datetime = datetime_from_str(upload_date).replace(tzinfo=dt.timezone.utc)
|
||||||
if upload_datetime >= datetime_from_str('today-2days'):
|
if upload_datetime >= datetime_from_str('today-2days'):
|
||||||
for fmt in info['formats']:
|
for fmt in info['formats']:
|
||||||
|
Loading…
Reference in New Issue
Block a user