From 788504577598eeb8ebe7867d444078bae7a47e59 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sat, 13 Jul 2024 20:43:01 +0800 Subject: [PATCH] [O] Too long, don't read --- api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api.py b/api.py index bd3e9c7..b778d03 100644 --- a/api.py +++ b/api.py @@ -92,6 +92,9 @@ async def generate(request: Request): language = data.get('language', '日本語') speed = data.get('speed', 1.0) + if len(text) > 200: + raise HTTPException(status_code=400, detail="TL;DR") + if not text or not speaker or language not in language_marks: raise HTTPException(status_code=400, detail="Invalid speaker or language (please check /tts/options)")