1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2026-02-21 16:06:13 +00:00

[rh:curl_cffi] Deprioritize unreliable impersonate targets (#16018)

Closes #16012
Authored by: bashonly
This commit is contained in:
bashonly
2026-02-20 17:48:16 -06:00
committed by GitHub
parent 97f03660f5
commit e74076141d

View File

@@ -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