mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-01 04:26:13 +00:00
Fixed infinite download retry loop in whisperai provider
This commit is contained in:
parent
d64d6b0a01
commit
b25d4164c2
3 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue