mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-02-22 08:26:00 +00:00
[rh:curl_cffi] Deprioritize unreliable impersonate targets (#16018)
Closes #16012 Authored by: bashonly
This commit is contained in:
@@ -175,6 +175,13 @@ _TARGETS_COMPAT_LOOKUP = {
|
|||||||
'safari180_ios': 'safari18_0_ios',
|
'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
|
@register_rh
|
||||||
class CurlCFFIRH(ImpersonateRequestHandler, InstanceStoreMixin):
|
class CurlCFFIRH(ImpersonateRequestHandler, InstanceStoreMixin):
|
||||||
@@ -192,6 +199,8 @@ class CurlCFFIRH(ImpersonateRequestHandler, InstanceStoreMixin):
|
|||||||
for version, targets in BROWSER_TARGETS.items()
|
for version, targets in BROWSER_TARGETS.items()
|
||||||
if curl_cffi_version >= version
|
if curl_cffi_version >= version
|
||||||
), key=lambda x: (
|
), 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
|
# deprioritize mobile targets since they give very different behavior
|
||||||
x[1].os not in ('ios', 'android'),
|
x[1].os not in ('ios', 'android'),
|
||||||
# prioritize tor < edge < firefox < safari < chrome
|
# prioritize tor < edge < firefox < safari < chrome
|
||||||
|
|||||||
Reference in New Issue
Block a user