diff options
| author | historia <historiavg@proton.me> | 2026-09-01 14:32:05 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-09-01 14:32:05 -0400 |
| commit | 6cfcd564c0684c52618235e6366f4a81c02b9a5b (patch) | |
| tree | 55321760a8103bc6b5d79489fac4135a60e6e3ba /app/converter/clients/faster.py | |
| parent | dc6e7cd43029da62dabe2513fb5aa8a34df1bd6d (diff) | |
| download | tts-audiobook-generator-6cfcd564c0684c52618235e6366f4a81c02b9a5b.tar.gz | |
slop refactor/dedup
Diffstat (limited to 'app/converter/clients/faster.py')
| -rw-r--r-- | app/converter/clients/faster.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/converter/clients/faster.py b/app/converter/clients/faster.py index 48c26ab..eeecee9 100644 --- a/app/converter/clients/faster.py +++ b/app/converter/clients/faster.py @@ -31,8 +31,8 @@ class FasterTTSClient(BaseTTSClient): def __init__(self, chunks_dir: Path, voice: Optional[str] = None, api_url: Optional[str] = None, - quiet: bool = False): - super().__init__(chunks_dir, quiet=quiet) + quiet: bool = False, cancel=None): + super().__init__(chunks_dir, quiet=quiet, cancel=cancel) # The voice is per-run (--voice / the Generate form's Voice pick); # there is no configured default. self.voice = (voice or "").strip() @@ -85,10 +85,12 @@ class FasterTTSClient(BaseTTSClient): except urllib.error.HTTPError as exc: detail = "" try: - detail = exc.read().decode("utf-8", errors="replace")[:200] + detail = exc.read().decode("utf-8", errors="replace") except Exception: pass - raise RuntimeError(f"Faster TTS server returned HTTP {exc.code}: {detail}") from exc + raise RuntimeError( + f"Faster TTS server returned HTTP {exc.code}: {detail[:200]}" + ) from exc except urllib.error.URLError as exc: raise RuntimeError(f"Faster TTS request failed: {exc.reason}") from exc if not pcm: |
