From 88bf54d0226438398c4b678d84947e42bf3920ab Mon Sep 17 00:00:00 2001 From: bel Date: Sun, 2 Apr 2023 10:48:41 -0600 Subject: [PATCH] url replaces hotword,context too --- rust-whisper.d/hotwords.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rust-whisper.d/hotwords.py b/rust-whisper.d/hotwords.py index f58ba09..769d8bd 100644 --- a/rust-whisper.d/hotwords.py +++ b/rust-whisper.d/hotwords.py @@ -319,9 +319,12 @@ class Actor(threading.Thread): body = self.body body = body.replace("{{hotword}}", hotword) body = body.replace("{{context}}", context) + url = self.url + url = url.replace("{{hotword}}", hotword) + url = url.replace("{{context}}", context) if os.environ.get("DEBUG", "") : - log("POST", self.url, headers, body) - requests.post(self.url, headers=headers, data=body) + log("POST", url, headers, body) + requests.post(url, headers=headers, data=body) except Exception as e: log("Actor.handle_url:", e)