diff --git a/bazarr/app/get_providers.py b/bazarr/app/get_providers.py index 026a20291..9ad4fd152 100644 --- a/bazarr/app/get_providers.py +++ b/bazarr/app/get_providers.py @@ -12,6 +12,7 @@ import requests import traceback import re +from requests import ConnectionError from subzero.language import Language from subliminal_patch.exceptions import TooManyRequests, APIThrottled, ParseResponseError, IPAddressBlocked, \ MustGetBlacklisted, SearchLimitReached diff --git a/libs/subliminal_patch/core.py b/libs/subliminal_patch/core.py index 59312ee85..59cfd22a3 100644 --- a/libs/subliminal_patch/core.py +++ b/libs/subliminal_patch/core.py @@ -38,7 +38,7 @@ logger = logging.getLogger(__name__) CUSTOM_PATHS = [] INCLUDE_EXOTIC_SUBS = True -DOWNLOAD_TRIES = 0 +DOWNLOAD_TRIES = 3 DOWNLOAD_RETRY_SLEEP = 6 # fixme: this may be overkill diff --git a/libs/subliminal_patch/providers/whisperai.py b/libs/subliminal_patch/providers/whisperai.py index 8aef88bc0..7e1b62bbb 100644 --- a/libs/subliminal_patch/providers/whisperai.py +++ b/libs/subliminal_patch/providers/whisperai.py @@ -233,7 +233,7 @@ class WhisperAIProvider(Provider): r = self.session.post(f"{self.endpoint}/detect-language", params={'encode': 'false'}, files={'audio_file': out}, - timeout=self.timeout) + timeout=(5, self.timeout)) logger.info(f"Whisper detected language of {path} as {r.json()['detected_language']}") @@ -290,6 +290,6 @@ class WhisperAIProvider(Provider): r = self.session.post(f"{self.endpoint}/asr", params={'task': subtitle.task, 'language': whisper_get_language_reverse(subtitle.audio_language), 'output': 'srt', 'encode': 'false'}, files={'audio_file': out}, - timeout=self.timeout) + timeout=(5, self.timeout)) subtitle.content = r.content