mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-06-12 22:04:42 +00:00
typo lol
This commit is contained in:
parent
c1df426180
commit
eb3680be9e
@ -40,7 +40,7 @@ class ExamplePTP(PoTokenProvider):
|
|||||||
_SUPPORTED_CLIENTS = ('WEB',)
|
_SUPPORTED_CLIENTS = ('WEB',)
|
||||||
_SUPPORTED_CONTEXTS = (PoTokenContext.GVS, )
|
_SUPPORTED_CONTEXTS = (PoTokenContext.GVS, )
|
||||||
|
|
||||||
_SUPPORTED_EXTERNAL_REQEUST_FEATURES = (
|
_SUPPORTED_EXTERNAL_REQUEST_FEATURES = (
|
||||||
ExternalRequestFeature.PROXY_SCHEME_HTTP,
|
ExternalRequestFeature.PROXY_SCHEME_HTTP,
|
||||||
ExternalRequestFeature.PROXY_SCHEME_SOCKS5H,
|
ExternalRequestFeature.PROXY_SCHEME_SOCKS5H,
|
||||||
)
|
)
|
||||||
@ -164,7 +164,7 @@ class TestPoTokenProvider:
|
|||||||
|
|
||||||
def test_provider_ignore_external_request_features(self, ie, logger, pot_request):
|
def test_provider_ignore_external_request_features(self, ie, logger, pot_request):
|
||||||
class InternalPTP(ExamplePTP):
|
class InternalPTP(ExamplePTP):
|
||||||
_SUPPORTED_EXTERNAL_REQEUST_FEATURES = None
|
_SUPPORTED_EXTERNAL_REQUEST_FEATURES = None
|
||||||
|
|
||||||
provider = InternalPTP(ie=ie, logger=logger, settings={})
|
provider = InternalPTP(ie=ie, logger=logger, settings={})
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ class TestPoTokenProvider:
|
|||||||
|
|
||||||
def test_provider_unsupported_external_request_source_address(self, ie, logger, pot_request):
|
def test_provider_unsupported_external_request_source_address(self, ie, logger, pot_request):
|
||||||
class InternalPTP(ExamplePTP):
|
class InternalPTP(ExamplePTP):
|
||||||
_SUPPORTED_EXTERNAL_REQEUST_FEATURES = tuple()
|
_SUPPORTED_EXTERNAL_REQUEST_FEATURES = tuple()
|
||||||
|
|
||||||
provider = InternalPTP(ie=ie, logger=logger, settings={})
|
provider = InternalPTP(ie=ie, logger=logger, settings={})
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ class TestPoTokenProvider:
|
|||||||
|
|
||||||
def test_provider_supported_external_request_source_address(self, ie, logger, pot_request):
|
def test_provider_supported_external_request_source_address(self, ie, logger, pot_request):
|
||||||
class InternalPTP(ExamplePTP):
|
class InternalPTP(ExamplePTP):
|
||||||
_SUPPORTED_EXTERNAL_REQEUST_FEATURES = (
|
_SUPPORTED_EXTERNAL_REQUEST_FEATURES = (
|
||||||
ExternalRequestFeature.SOURCE_ADDRESS,
|
ExternalRequestFeature.SOURCE_ADDRESS,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ class TestPoTokenProvider:
|
|||||||
|
|
||||||
def test_provider_unsupported_external_request_tls_verification(self, ie, logger, pot_request):
|
def test_provider_unsupported_external_request_tls_verification(self, ie, logger, pot_request):
|
||||||
class InternalPTP(ExamplePTP):
|
class InternalPTP(ExamplePTP):
|
||||||
_SUPPORTED_EXTERNAL_REQEUST_FEATURES = tuple()
|
_SUPPORTED_EXTERNAL_REQUEST_FEATURES = tuple()
|
||||||
|
|
||||||
provider = InternalPTP(ie=ie, logger=logger, settings={})
|
provider = InternalPTP(ie=ie, logger=logger, settings={})
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ class TestPoTokenProvider:
|
|||||||
|
|
||||||
def test_provider_supported_external_request_tls_verification(self, ie, logger, pot_request):
|
def test_provider_supported_external_request_tls_verification(self, ie, logger, pot_request):
|
||||||
class InternalPTP(ExamplePTP):
|
class InternalPTP(ExamplePTP):
|
||||||
_SUPPORTED_EXTERNAL_REQEUST_FEATURES = (
|
_SUPPORTED_EXTERNAL_REQUEST_FEATURES = (
|
||||||
ExternalRequestFeature.DISABLE_TLS_VERIFICATION,
|
ExternalRequestFeature.DISABLE_TLS_VERIFICATION,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ class MyPoTokenProviderPTP(PoTokenProvider): # Provider name must end with "PTP
|
|||||||
# If your provider makes external requests to websites (i.e. to youtube.com) using another library or service (i.e., not _request_webpage),
|
# If your provider makes external requests to websites (i.e. to youtube.com) using another library or service (i.e., not _request_webpage),
|
||||||
# set the request features that are supported here.
|
# set the request features that are supported here.
|
||||||
# If only using _request_webpage to make external requests, set this to None.
|
# If only using _request_webpage to make external requests, set this to None.
|
||||||
_SUPPORTED_EXTERNAL_REQEUST_FEATURES = (
|
_SUPPORTED_EXTERNAL_REQUEST_FEATURES = (
|
||||||
ExternalRequestFeature.PROXY_SCHEME_HTTP,
|
ExternalRequestFeature.PROXY_SCHEME_HTTP,
|
||||||
ExternalRequestFeature.SOURCE_ADDRESS,
|
ExternalRequestFeature.SOURCE_ADDRESS,
|
||||||
ExternalRequestFeature.DISABLE_TLS_VERIFICATION
|
ExternalRequestFeature.DISABLE_TLS_VERIFICATION
|
||||||
|
|||||||
@ -117,7 +117,7 @@ class PoTokenProvider(IEContentProvider, abc.ABC, suffix='PTP'):
|
|||||||
# If making external requests to websites (i.e. to youtube.com) using another library or service (i.e., not _request_webpage),
|
# If making external requests to websites (i.e. to youtube.com) using another library or service (i.e., not _request_webpage),
|
||||||
# add the request features that are supported.
|
# add the request features that are supported.
|
||||||
# If only using _request_webpage to make external requests, set this to None.
|
# If only using _request_webpage to make external requests, set this to None.
|
||||||
_SUPPORTED_EXTERNAL_REQEUST_FEATURES: tuple[ExternalRequestFeature] | None = ()
|
_SUPPORTED_EXTERNAL_REQUEST_FEATURES: tuple[ExternalRequestFeature] | None = ()
|
||||||
|
|
||||||
def __validate_request(self, request: PoTokenRequest):
|
def __validate_request(self, request: PoTokenRequest):
|
||||||
if not self.is_available():
|
if not self.is_available():
|
||||||
@ -147,11 +147,11 @@ class PoTokenProvider(IEContentProvider, abc.ABC, suffix='PTP'):
|
|||||||
'socks5': ExternalRequestFeature.PROXY_SCHEME_SOCKS5,
|
'socks5': ExternalRequestFeature.PROXY_SCHEME_SOCKS5,
|
||||||
'socks5h': ExternalRequestFeature.PROXY_SCHEME_SOCKS5H,
|
'socks5h': ExternalRequestFeature.PROXY_SCHEME_SOCKS5H,
|
||||||
}.items()
|
}.items()
|
||||||
if feature in (self._SUPPORTED_EXTERNAL_REQEUST_FEATURES or [])
|
if feature in (self._SUPPORTED_EXTERNAL_REQUEST_FEATURES or [])
|
||||||
}
|
}
|
||||||
|
|
||||||
def __validate_external_request_features(self, request: PoTokenRequest):
|
def __validate_external_request_features(self, request: PoTokenRequest):
|
||||||
if self._SUPPORTED_EXTERNAL_REQEUST_FEATURES is None:
|
if self._SUPPORTED_EXTERNAL_REQUEST_FEATURES is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
if request.request_proxy:
|
if request.request_proxy:
|
||||||
@ -160,11 +160,11 @@ class PoTokenProvider(IEContentProvider, abc.ABC, suffix='PTP'):
|
|||||||
raise PoTokenProviderRejectedRequest(
|
raise PoTokenProviderRejectedRequest(
|
||||||
f'External requests by "{self.PROVIDER_NAME}" provider do not support proxy scheme "{scheme}". Supported proxy schemes: {", ".join(self._supported_proxy_schemes) or "none"}')
|
f'External requests by "{self.PROVIDER_NAME}" provider do not support proxy scheme "{scheme}". Supported proxy schemes: {", ".join(self._supported_proxy_schemes) or "none"}')
|
||||||
|
|
||||||
if request.request_source_address and ExternalRequestFeature.SOURCE_ADDRESS not in self._SUPPORTED_EXTERNAL_REQEUST_FEATURES:
|
if request.request_source_address and ExternalRequestFeature.SOURCE_ADDRESS not in self._SUPPORTED_EXTERNAL_REQUEST_FEATURES:
|
||||||
raise PoTokenProviderRejectedRequest(
|
raise PoTokenProviderRejectedRequest(
|
||||||
f'External requests by "{self.PROVIDER_NAME}" provider do not support setting source address')
|
f'External requests by "{self.PROVIDER_NAME}" provider do not support setting source address')
|
||||||
|
|
||||||
if not request.request_verify_tls and ExternalRequestFeature.DISABLE_TLS_VERIFICATION not in self._SUPPORTED_EXTERNAL_REQEUST_FEATURES:
|
if not request.request_verify_tls and ExternalRequestFeature.DISABLE_TLS_VERIFICATION not in self._SUPPORTED_EXTERNAL_REQUEST_FEATURES:
|
||||||
raise PoTokenProviderRejectedRequest(
|
raise PoTokenProviderRejectedRequest(
|
||||||
f'External requests by "{self.PROVIDER_NAME}" provider do not support ignoring TLS certificate failures')
|
f'External requests by "{self.PROVIDER_NAME}" provider do not support ignoring TLS certificate failures')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user