From bf167dfd9ecd7ad0f05ab253c9ac366a91d01b81 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Mon, 29 Jun 2026 22:20:48 -0400 Subject: [PATCH] no log: Improved request logging in OpenSubtitles provider by adding checks for empty requests and responses before processing to prevent exceptions and throttling of the provider for no reason. --- custom_libs/subliminal_patch/providers/opensubtitlescom.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/custom_libs/subliminal_patch/providers/opensubtitlescom.py b/custom_libs/subliminal_patch/providers/opensubtitlescom.py index 159084105..182905aee 100644 --- a/custom_libs/subliminal_patch/providers/opensubtitlescom.py +++ b/custom_libs/subliminal_patch/providers/opensubtitlescom.py @@ -606,6 +606,10 @@ class OpenSubtitlesComProvider(ProviderRetryMixin, Provider): def log_request_response(response, non_standard=True): + if not response or not response.request: + logger.debug("No request or response to log.") + return + redacted_request_headers = response.request.headers if 'Authorization' in redacted_request_headers and isinstance(redacted_request_headers['Authorization'], str): redacted_request_headers['Authorization'] = redacted_request_headers['Authorization'][:-8]+8*'x'