From e74076141dc86d5603680ea641d7cec86a821ac8 Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Fri, 20 Feb 2026 17:48:16 -0600 Subject: [PATCH] [rh:curl_cffi] Deprioritize unreliable impersonate targets (#16018) Closes #16012 Authored by: bashonly --- yt_dlp/networking/_curlcffi.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/yt_dlp/networking/_curlcffi.py b/yt_dlp/networking/_curlcffi.py index 88354f7095..5e0d3e5569 100644 --- a/yt_dlp/networking/_curlcffi.py +++ b/yt_dlp/networking/_curlcffi.py @@ -175,6 +175,13 @@ _TARGETS_COMPAT_LOOKUP = { 'safari180_ios': 'safari18_0_ios', } +# These targets are known to be insufficient, unreliable or blocked +# See: https://github.com/yt-dlp/yt-dlp/issues/16012 +_DEPRIORITIZED_TARGETS = { + ImpersonateTarget('chrome', '133', 'macos', '15'), # chrome133a + ImpersonateTarget('chrome', '136', 'macos', '15'), # chrome136 +} + @register_rh class CurlCFFIRH(ImpersonateRequestHandler, InstanceStoreMixin): @@ -192,6 +199,8 @@ class CurlCFFIRH(ImpersonateRequestHandler, InstanceStoreMixin): for version, targets in BROWSER_TARGETS.items() if curl_cffi_version >= version ), key=lambda x: ( + # deprioritize unreliable targets so they are not selected by default + x[1] not in _DEPRIORITIZED_TARGETS, # deprioritize mobile targets since they give very different behavior x[1].os not in ('ios', 'android'), # prioritize tor < edge < firefox < safari < chrome