aboutsummaryrefslogtreecommitdiff
path: root/audiobook.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-08-26 19:58:45 -0400
committerhistoria <historiavg@proton.me>2026-08-26 19:58:45 -0400
commit975bd960fd07e75799b8e3adc4c0033046b34792 (patch)
tree6d5a13c0ad6eb3a6afeb5659bd9e9e21e8c215bc /audiobook.py
parent5af37bbd575eec89c6ac2fecf2d8c2eda4c1728d (diff)
downloadtts-audiobook-generator-975bd960fd07e75799b8e3adc4c0033046b34792.tar.gz
feat: language and option fields in tui, context-sensitive voice label
Diffstat (limited to 'audiobook.py')
-rwxr-xr-xaudiobook.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/audiobook.py b/audiobook.py
index 5569070..f95e1d3 100755
--- a/audiobook.py
+++ b/audiobook.py
@@ -371,11 +371,14 @@ Examples:
if args.backend != BACKEND_AUDIOCPP:
parser.error("--option requires --backend audiocpp; the options "
"are passed through to the audio.cpp model")
- for item in args.option:
- key, sep, value = item.partition("=")
- if not sep or not key.strip():
- parser.error(f"--option expects KEY=VALUE (got {item!r})")
- request_options[key.strip()] = value
+ from backends.common import parse_request_options
+ try:
+ # Joined with spaces so both "--option a=1 --option b=2" and a
+ # single quoted "a=1, b=2" parse identically (the shared parser
+ # splits on commas or whitespace).
+ request_options = parse_request_options(" ".join(args.option))
+ except ValueError as exc:
+ parser.error(str(exc))
api_url = None
if args.api_url is not None: