A feature-rich command-line audio/video downloader
[rh:curl_cffi] Deprioritize unreliable impersonate targets (#16018)
bashonlye74076141dc8
diff --git a/yt_dlp/networking/_curlcffi.py b/yt_dlp/networking/_curlcffi.pyindex 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_rhclass 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 behaviorx[1].os not in ('ios', 'android'),# prioritize tor < edge < firefox < safari < chrome